Difference between BricsCAD and AutoCAD Lisp
Comments
-
When I test it the list function works correctly on V24 with your file.
0 -
Thank you for confirming.I am sorry. I didn't have enough information.
When I executed one line of the previous Lisp, it moved normally.When the following Lisp is executed, the concept is not changed.
However, my environment is Japanese, so please change it to “modeing” or something like that.Is there a solution?
(defun c:test1(/)
(command-s "_wscurrent" "モデリング")
(command-s "_vscurrent" "c")
(command-s "-view" "_swiso")
)
0 -
This worked for me. V25.
(command "_wscurrent" "modeling")
Then
(command "_wscurrent" "Alan") ; return back to default ws.
0 -
I made a new discovery.
(defun c:test1(/ osnp)
;(command-s "_wscurrent" "モデリング")
(command-s "_vscurrent" "c")
(command-s "-view" "_swiso")
)
I ran it, and here are the resultsOnce I run UnDo
This means that once the display style changes to Conceptual,
the next time I switch views, it looks like I'm back to 2D wireframe!
Why is this?
0 -
Not sure your code is sound. I think it should read
(defun c:test1(/ osnp)
(command-s "_vscurrent" "c")
(command-s "-view" "r" "_swiso")
)I think the view command fails inside test1 so the next time you use 'Undo' you are actually undoing the last successful command which was "vscurrent"
-1 -
"_SWISO" is a preset view option. For these you don't use the restore option, just call the preset view name directly.
e.g.
(command "._VIEW" "_R" "_SWISO") ; won't work, as _SWISO is not a named view
(command "._VIEW" "_SWISO") ; Will workFor reference, here is the list of all (i think) preset view names.
_TOP
_BOTTOM
_LEFT
_RIGHT
_FRONT
_BACK
_SWISO
_SEISO
_NEISO
_NWISO; You can also use just the first 3 letters when setting.
When you have LISP that is making multiple command calls or setting changes, it is useful to wrap the Lisp command calls in undo marks. Doing this will allow you to step back the entire LISP command in one undo. If you don't do this, then it will step back each command call one by one.
The acet-error-init express tool lisp function can be used to create these undo marks for you, plus set and restore and environment variables.
e.g.
(defun C:TEST1 ()
(cond
((> (getvar 'CVPORT) 1) ; Check that we are in model space
(acet-error-init '(("CMDECHO" 0) 0 nil)) ; Set error handler & create undo mark
;(command "._WSCURRENT" "モデリング") ; Set current workspace
(command "._WSCURRENT" "Modeling") ; Set current workspace
(command "._VIEW" "_SWISO") ; Set the view to built-in preset view South West Iso
(command "._VSCURRENT" "_C") ; set viewstyle to conceptual
(acet-error-restore) ; restore error
)
(T (princ "\nCommand not available in Paper space"))
)
(prin1)
)Jason Bourhill
CAD Concepts Ltd
cadconcepts.co.nz1 -
I changed the order of the programs and they now display well.
I do not know the cause of the problem.
(defun c:test1(/)
(command-s "-view" "_swiso")
(command-s "_vscurrent" "c")
)
Thank you very much.0