Message 1 of 16

Not applicable
08-28-2017
03:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I have bunch of circles with two different radiuses (see screenshot below):
They are all on "ASBUILT" layer.
I would like to grab them all by following SSGETs:
(setq ss-lv-poles (ssget "_x" '((-4 . "<or") (-4 . "<and") (0 . "circle") (8 . "ASBUILT") (40 . 0.75) (-4 . "and>") (-4 . "or>")) ) ) (setq ss-Hv-poles (ssget "_x" '((-4 . "<or") (-4 . "<and") (0 . "circle") (8 . "ASBUILT") (40 . 1.7) (-4 . "and>") (-4 . "or>")) ) )
And pass them to a function that I have (Thanks to Lee Mac's useful post) and replace them with a Dynamic block named "Power Pole". The smaller circle should have "Low Voltage Pole" as for its visibility state. Likewise, the double concentric circles should be replaced by same dynamic block with "Low Voltage, High Voltage Pole" visibility state.
Here is my code:
(defun PoleSymbolReplace (ss1 ss2/ loopLength1 loopLength2 index1 index2 FlagVariable en1 en2 el1 el2 as1 as2) (if (/= ss1 nil) (progn (setq loopLength1 (sslength ss1)) (setq index1 0) (repeat loopLength1 (setq FlagVariable nil) (setq en1 (ssname ss1 index)) (setq el1 (entget en1)) (setq index1 (+ 1 index1)) (progn (setq as1 (assoc 10 el1)) (setq xyz (cdr as1)) (if (/= ss2 nil) (progn (setq loopLength2 (sslength ss2)) (setq index2 0) (repeat loopLength2 (setq en2 (ssname ss2 index2)) (setq el2 (entget en2)) (setq index2 (+ 1 index2)) (progn (setq as2 (assoc 10 el2)) (if (equal as1 as2 0.001) (progn (LM:insertwithstate "Power Pole" "Low Voltage, High Voltage Pole" xyz) (entdel en2) (entdel en1) (setq FlagVariable T) ) ) ) ) ) ) (if (not FlagVariable) (progn (LM:insertwithstate "Power Pole" "Low Voltage Pole" xyz) (entdel en1) ) ) ) ) ) ) (princ) )
But when I call it by:
(PoleSymbolReplace ss-lv-poles ss-Hv-poles)
I get error: too few arguments
What am I doing wrong here?
Solved! Go to Solution.