UCS face and view change (plan)...
in Other
We want ucs face and view change (plan)...
1. UCS face select 3d face ..... (command "ucs" "face")
2. Did selection screen ucs change,( before select ucs face) ....(command "plan" "")
(defun c:mur ()
(command "ucs" "face")
(command "plan" "")
(PRINC "\ucs face and screen change ..")
)
?? how to ??
0
Comments
-
Hello:A couple of small changes to your lisp, in the UCS command I have added, after "face" a pause and an enter ("") The pause halts the lisp and allows the user to pick their face, the enter at the end accepts the new UCS - the "" at the end of this line is equivalent to "accept" in this case - it's just a shorter way to code it. I have also added a ._ to the ucs and plan commands - this ensures that the default commands are used in the event that another program has redefined how one of them works - an example of this below...Your adjusted code...(defun c:mur ()
(command "._ucs" "face" pause "")
(command "._plan" "")
(PRINC "\ucs face and screen change ..")
)[/code]A quick example of undefining a command so that you can add some more functionality to it. The example below undefines the plan command and then recreates a new customized PLAN command which will display a message and then run the default plan command. Note that the line (command "._plan") includes the ._ this will call the default PLAN command after displaying a message. In this example if you did not include the ._ you would get yourself into an infinite loop, as the program would run the new PLAN command as opposed the default PLAN command. Redfine a command using the redefine command and type the name of the command, in this case PLAN at the prompt[code](command "._undefine" "plan")(defun c:plan ()(princ "\nSOME NICE MESSAGE OR SOME NEW FUNCTIONALITY GOES HERE")(princ) ;<-- An extra princ so that we don't get a nil on the command line - this is purely for asthetics. <br style="background-color: rgb(247, 248, 250); color: rgb(34, 34, 34); font-size: 13px; text-align: justify;"> (command "._plan") ;<-- Call to the default plan command</span>
)[/code]0 -
Hi Engin,
If you set UCSFOLLOW to on, then the view will automatically change to the plan view of the selected UCS. Your code would change to look like this
[code](defun c:mur ()
(PRINC "\nUCS face and screen change ..")
(setvar "UCSFOLLOW" 1) ; Turn UCS Follow on. This will automatically got to the plan view on changing UCS.
(command "._UCS" "_FACE")
;(command "plan" "") ; not required if UCSFOLLOW is on
)[/code]
This method retains the option within the UCS command to flip or rotate the ucs prior to accepting.
Regards,Jason Bourhill
CAD Concepts0 -
Try pasting the code again. Previous posts seems to have got caught up with a hyperlink.
[code](defun c:mur ()
(PRINC "\nUCS face and screen change ..")
(setvar "UCSFOLLOW" 1) ; Turn UCS Follow on. This will automatically got to the plan view on changing UCS.
(command "._UCS" "_FACE")
;(command "plan" "") ; not required if UCSFOLLOW is on
)[/code]
Regards,Jason Bourhill
CAD Concepts0
This discussion has been closed.