CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 01-13-2011, 04:59 AM
Oscar Nurtaev Oscar Nurtaev is offline
Registered User
 
Join Date: Jan 2011
Posts: 1
Modifying relation parameter with LISP Macro

Hello,

My name is Oscar and I'm kinda new in LISP trying to learn some on myself, but we are currently working on the project that needs to be done fast and I have no time enough to complete my LISP "research". We're using parametric model with one dimension that is changeable and the others depend on the first one via applied expressions. The task is to create a startup dialog that would ask for the first parameter and then modify the parametric relation for that first dimension with the entered value. I was able to create a dialog box asking for the diameter value, but I'm kinda stuck how to pass that new value to the function of modifying the parametric relation and change it. Below is my code, any help is highly appreciated!

Oscar


(use-package li)

(sd-defdialog 'dia-test
:dialog-title "Enter Diameter"
:variables
'((newdiameter :value-type :number
:title "New diameter")))

:local-functions '(
(doit()

k-action
'(doit

(sd-call-cmds (modify_parametric_relation "dia1" (newdiameter)))

:cleanup-action
'(doit

(sd-call-cmds (AM_CURRENT_SHEET (sd-am-inq-curr-sheet-name)))
)
)
)
Reply With Quote
  #2  
Old 01-25-2011, 10:04 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Re: Modifying relation parameter with LISP Macro

the cleanup action you don't need... the one u used is for annotation. but relations are 3D world.. so why manipulate Annotation when staying in 3D.

for this tiny thing a local function looks a little bit like overkill to me.

typed, not tested:
Code:
(in-package :my-stuff)
(use-package :oli)

(sd-defdialog 'dia-test
  :dialog-title "Enter Diameter"
  :variables
    '(
       (newdiameter :value-type :length
                    :title "New diameter")
      ) ;; end variables              
  :ok-action
   '(sd-call-cmds (modify_parametric_relation "dia1" newdiameter))
   ) ;; end dialog
Whether the syntax in the sd-call-cmds is correct.. I can't test, I assume you used the recorder....

Please use the forum tag [ code ] when posting code! Thanks.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:14 PM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.