- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am writing a LISP to convert all point styles in a Civil 3D drawing from a fixed-scale format to a drawing scale format. The LISP addresses each point style in the drawing and applies a specific size to the point style based on our CAD standards. For the most part, it works very well. I'm only running into problems when the LISP encounters a point style that should be in the drawing, but isn't. (e.g. the style was deleted sometime after the drawing was created from the template.) So, I believe I need to write some logic to determine if the point style exists in the drawing before executing the three lines of code that modify the style. I am able to access the point styles VLA-OBJECT (#<VLA-OBJECT IAeccPointStyles 000002590c8d67e0> ) and I am able to modify an 'item within that object by calling it out directly. I just can't figure out how to have the LISP verify whether or not the point style exists and write if/then logic around it. Thanks in advance if you're able to help. Here's a snip of the code I'm using:
(defun getlandapp (/ c3d verstring prodstring)
(setq c3d (strcat "HKEY_LOCAL_MACHINE\\"
(if vlax-user-product-key
(vlax-user-product-key)
(vlax-product-key))
)
c3d (vl-registry-read c3d "Release")
verstring (substr c3d 1 (vl-string-search "." c3d (+ (vl-string-search "." c3d) 1)))
prodstring (strcat "AeccXUiLand.AeccApplication." verstring))
(if (setq c3d (vla-getinterfaceobject (vlax-get-acad-object) prodstring))
c3d
nil)
)
(setq PtStyles (vlax-get (vla-get-activedocument (getlandapp)) 'pointstyles))
;;;want to insert logic here to say "If style "ACON" exists, then modify values, if not, skip skip to next style below";;;
(setq ptACON (vlax-get-property PtStyles 'item "ACON"));get the Point Style
(vlax-put-property ptACON 'MarkerSize (/ 0.12 12));set the size
(setq ptACON nil)
;
(setq ptATNA (vlax-get-property PtStyles 'item "ATNA"));get the Point Style
(vlax-put-property ptATNA 'MarkerSize (/ 0.12 12));set the size
(setq ptATNA nil)
Solved! Go to Solution.