Hi guys. I need your help. I need this routine to decide if it's border1(TITLEBLOCKA) OR border #2 (iTITLEBLOCKB) and perform actions depending on which border it find.
I wanted to go into a drawing, check to see if it has TITLEBLOCKA or TITLEBLOCKB.
If TITLEBLOCKA, rename it ABCDE, THEN move its insertion point to the origin.
If TITLEBLOCKB, rename it ABCDE, THEN move its insertion point to the origin.
Hopefully someone can help solve this one mystery!
Thank you, thank you, thank you!.
(if (setq ss (ssget "x" (list (cons 0 "INSERT") (cons 2 "TITLEBLOCKA"))))
(vla-put-Name
(vla-item
(vla-get-Blocks
(vla-get-ActiveDocument
(vlax-get-acad-object)
)
)
"TITLEBLOCKA") ;;;<-- old block name
"abcde") ;;;< -- new block name
)
(if (setq B3Set (ssget "x" '((0 . "INSERT")(2 . "abcde"))))
(progn
(setq ename1 (ssname B3Set 0))
(setq InsPt (cdr (assoc 10 (entget ename1))))
(command "._move" "all" "" InsPt '(0.0 0.0))
; (command "._move" "all" "" "0,0" "@2.06155<194")
)
)
)
(if (setq ss (ssget "x" (list (cons 0 "INSERT") (cons 2 "TITLEBLOCKB"))))
(vla-put-Name
(vla-item
(vla-get-Blocks
(vla-get-ActiveDocument
(vlax-get-acad-object)
)
)
"TITLEBLOCKB") ;;;<-- old block name
"abcde") ;;;< -- new block name
).
(if (setq B3Set (ssget "x" '((0 . "INSERT")(2 . "abcde"))))
(progn
(setq ename1 (ssname B3Set 0))
(setq InsPt (cdr (assoc 10 (entget ename1))))
(command "._move" "all" "" InsPt '(0.0 0.0))
(command "._move" "all" "" "0,0" "@2.06155<194")
)
)
)
);end of IF.
[\code}.....