Jump to content

Enter a value after DView Twist, then go to UCS View...


jt6572

Recommended Posts

hi all,

as the title says, i would like to be able to continue a simple lisp i have for DView TWist so that i can enter the twist angle and then have the crosshairs automatically revert to UCS View.

 

i have two very simple parts to this (i am by no means Dr Lisp!!) and would really appreciate some help on how to link the two, or if this is not possible.

 

ideally, there would be a sort of wildcard like * that means the user inputs a value - much like "" represents ENTER, but as i say, i dont really know what i am doing...

 

here is where i am so far:

 

1. DView TWist:

 

(defun c:DVT() (command "DVIEW" "" "TW"))

 

2. UCS View is just

 

(defun c:UV() (command "ucs" "V"))

 

3. got this from AutoDesk

 

(defun c:AskForInteger ( / )

(setq int (getint "\nEnter an integer: "))

 

(if int

(prompt (strcat "\nUser entered: " (itoa int)))

(prompt "\nUser did not provide an integer.")

)

(princ)

)

 

thank you. :)

Link to comment
Share on other sites

Try this macro:

^C^C_dview;all;;tw;\;^P(progn(setvar "snapang" (- (getvar "viewtwist")))(princ)) 

Pick or enter the twist angle when prompted and it automaticly sets the snap angle horizontal afterwards.

Link to comment
Share on other sites

Try this macro:
^C^C_dview;all;;tw;\;^P(progn(setvar "snapang" (- (getvar "viewtwist")))(princ)) 

Pick or enter the twist angle when prompted and it automaticly sets the snap angle horizontal afterwards.

 

thanks very much tombu!

i have allocated a shortcut key for that. :)

Link to comment
Share on other sites

thanks very much tombu!

i have allocated a shortcut key for that. :)

 

We're glad to help, but following the Code Posting Guidelines helps us help you.

 

The # symbol in the Toolbar above as you're posting is to wrap

 tags around text.  This makes them easier to read within posts by making them distinct from other text.  It helps those who may want to copy and paste the code.  It also helps to save space because code blocks get a scroll bar beyond a certain number of lines.

 

Most forums use [code] tags, this site's Toolbar makes it easier that most.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...