jt6572 Posted November 3, 2016 Share Posted November 3, 2016 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. Quote Link to comment Share on other sites More sharing options...
tombu Posted November 4, 2016 Share Posted November 4, 2016 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. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted November 4, 2016 Share Posted November 4, 2016 Please read the Code Posting Guidelines and edit your Code to be included in Code Tags. (not Quote Tags) [NOPARSE] Your Code Here[/NOPARSE] = Your Code Here Quote Link to comment Share on other sites More sharing options...
jt6572 Posted November 6, 2016 Author Share Posted November 6, 2016 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. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted November 7, 2016 Share Posted November 7, 2016 Please read the Code Posting Guidelines and edit your Code to be included in Code Tags. (not Quote Tags) [NOPARSE] Your Code Here[/NOPARSE] = Your Code Here Quote Link to comment Share on other sites More sharing options...
tombu Posted November 8, 2016 Share Posted November 8, 2016 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. Quote Link to comment Share on other sites More sharing options...
jt6572 Posted November 8, 2016 Author Share Posted November 8, 2016 okay, i will read the code posting guidelines before i post again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.