
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am fairly new at writing LISP and only have a basic knowledge of it.
I have writen a macro/lisp to draw multilines of certain styles.
I have 2 problems with it currently.
1. I cant get it to revert back to the current layer when an error occurs. and unless there is a better way of doing this in order to complete the function you have to escape (so an error will always occur)
It is more of a macro than a LISP as all it is designed to do is load a certain multiline style and use it.
I dont want it to be overly complicated in that I want it to draw just like any other line or polyline.
2. Setting a location to find the muliline style from, as at the moment it opens a dialog box and you have to go and find it manually.
Here is the code for the LISP:
;Draw multiline using LBW MLStyle
(DEFUN C:MLLBW ( / *error* )
;error trap
(defun *error* ( msg )
(if oldl (setvar "clayer" oldl))
(if (not (member msg '("Function cancelled" "quit / exit abort")))
(princ (strcat "\nError: " msg))
)
(princ)
);end error trap function
;store current layer
(setq oldl (getvar "CLAYER"))
;function
(setq mlst "LBW") ;multiline style used
(command "layer" "m" "ARCHITECT" "") ;change layer to architect layer
(command "mline" "st" mlst "s" "1" "j" "z" ) ;draw multiline with LBW style
)
I have also attached atached the .mln file used for the styles (In order to attach I had to change the extension to .bmp to be valid it will need to be changed back to .mln to work correctly)
Thanks for your help
Solved! Go to Solution.