Re: Convert Explode command to Burst command?
Quote:
Originally Posted by
stusic
Why does it work when I just use explode?
It shouldn't.
Replace all the foreach with the following:
Code:
(sssetfirst nil (ssadd (vlax-vla-object->ename tmp)))
(c:burst)
This will select a temporarily created pickset (ssget style) from the inserted block (converted from vla-object to ename) and the run burst.
Re: Convert Explode command to Burst command?
Try:
Code:
(foreach com (xins:massoc "compressor" lst) ;; For the contents of every <compressor> tag in the <rack>
;; Insert Block at insertion point 'ins'
(setq ss (ssadd)
tmp ;; VLA Block Reference object
(vla-insertblock
spc ;; Modelspace object
(vlax-3d-point ins) ;; Insertion point Safearray Variant
"M-GROUP-CSC-XML" ;; Block name (exists in drawing as tested earlier)
1.0 1.0 1.0 0.0 ;; (Scale=1:1, Rotation=0.0)
) ;; end vla-insertblock
) ;; end setq
(cond
;;----------------------------------------------------------------------;;
;; Condition
( (null (setq mod (xins:assoc "model" com))) ;; Contents of <model> tag
;; Notify user of such:
(princ
(strcat
"\nModel Number not found for Compressor located at "
(xins:lst->str (mapcar 'rtos ins) ",") ;; Include insertion point of Compressor for clarity
) ;; end strcat
) ;; end princ
) ;; end condition
;;----------------------------------------------------------------------;;
;; Condition
( (and
(setq csg (xins:assoc "suction_group" com)) ;; Finds suction group of compressor
(< (atoi (cadr (assoc csg rsg))) 0) ;; Sees if suction group is LT ot MT
(or (= (setq csf (xins:assoc "suction_shell" com)) "NONE") ;; Determines suction filter per comp
(= (setq csf (xins:assoc "suction_shell" com)) nil)
)
)
;; Set visibility state of block accordingly:
(vla-put-activelayer
(setq acdoc (vla-get-activedocument (vlax-get-acad-object)))
(vla-item (vla-get-layers acdoc) "M-PIPING-INS-1-0")
)
(xins:setvisibilitystate tmp "DIP TUBE") ;; Sets the visibility state
) ;; end condition
;;----------------------------------------------------------------------;;
) ;; end cond
(setq tmp (vlax-vla-object->ename tmp)) ;; to entity
(ssadd tmp ss) ;; add to selection set
(sssetfirst nil ss)
(c:burst)
(setq ins (mapcar '+ ins '(12.3933 0.0 0.0))) ;; Shift the insertion point by a given vector
)
Re: Convert Explode command to Burst command?
Quote:
Originally Posted by
stusic
Why does it work when I just use explode?
Quote:
Originally Posted by
alanjt
It shouldn't.
The Explode method returns a variant (vla-explode), or a list (vlax-invoke <obj> 'explode) of the exploded objects as a native LispFunction Method, whereas BURST is an Express Tool and is not a native Command, Method, etc., nor does it follow the same behavior.
Are you swapping Explode for Burst, or are you invoking burst in addition to Explode... I'm quite confused at your intent here.
Re: Convert Explode command to Burst command?
Quote:
Originally Posted by
BlackBox
Are you swapping Explode for Burst, or are you invoking burst in addition to Explode... I'm quite confused at your intent here.
I'd like to swap explode for burst. The explode method worked well elsewhere in the code, but for this instance, I'd like to retain the layers the blocks are inserted on, so burst seemed like a natural choice.
Re: Convert Explode command to Burst command?
Quote:
Originally Posted by
stusic
I'd like to swap explode for burst. The explode method worked well elsewhere in the code, but for this instance, I'd like to retain the layers the blocks are inserted on, so burst seemed like a natural choice.
Wish you said that when you started the thread.
Re: Convert Explode command to Burst command?
Quote:
Originally Posted by
alanjt
It shouldn't.
Replace all the foreach with the following:
Code:
(sssetfirst nil (ssadd (vlax-vla-object->ename tmp)))
(c:burst)
This will select a temporarily created pickset (ssget style) from the inserted block (converted from vla-object to ename) and the run burst.
Wow. Okay. That worked. After s#$dh%@cv#$s with that all day, you've helped me tremendously.
Tom, I tried your modification as well and that also worked.
After all this, I think the main thing that messed all this up was my use of FOREACH. Like BlackBox was referring to, it worked with the native acad commands, but didn't when a non-native command was introduced. Once I scrapped that, things got much easier.
I can't thank you guys enough. So much help from a bunch of folks.
And now...
http://i.imgur.com/usvXLjR.jpeg
Re: Convert Explode command to Burst command?
Quote:
Originally Posted by
Tom Beauford
Wish you said that when you started the thread.
This.
Quote:
Originally Posted by
stusic
I can't thank you guys enough. So much help from a bunch of folks.
... Glad you got it sorted. :beer:
Re: Convert Explode command to Burst command?
Quote:
Originally Posted by
BlackBox
This
Sorry, I thought I was clear, but I understand a lot gets lost when you're not actually looking at the whole picture (I also thought it'd be a quick fix).
Re: Convert Explode command to Burst command?
Quote:
Originally Posted by
stusic
Sorry, I thought I was clear, but I understand a lot gets lost when you're not actually looking at the whole picture (I also thought it'd be a quick fix).
lol. It rarely is.
Re: Convert Explode command to Burst command?
Quote:
Originally Posted by
stusic
Sorry, I thought I was clear, but I understand a lot gets lost when you're not actually looking at the whole picture (I also thought it'd be a quick fix).
No worries; you know I'm happy to help you, stusic... I was just reiterating the importance of the question-asker being as clear as possible from the outset... I meant no offense, of course. :beer: