Code Red > AutoLISP (Vanilla / Visual)
How to get insertionpoint of block when select attribute
(1/1)
HasanCAD:
HI all
when select attribute (vlax-get objVL 'insertionpoint) gives the attribute insertionpoint
How to get the block insertionpoint?
This what I am using
--- Code - Auto/Visual Lisp: --- (setq obj (car (nentsel "\nSelect Origin attribute/Text : "))) (setq objVL (vlax-ename->vla-object obj)) (setq objVL-Strng (vlax-get objVL 'textstring)) (setq objVL-inspnt (vlax-get objVL 'insertionpoint))
Grrr1337:
Using activex, probably like this:
--- Code - Auto/Visual Lisp: ---(and (setq att (car (nentsel "\nSelect attribute: "))) (= "ATTRIB" (cdr (assoc 0 (entget att)))) (setq attobj (vlax-ename->vla-object att)) (setq blkobj (vla-ObjectIdToObject (vla-get-ActiveDocument (vlax-get-acad-object)) (vla-get-OwnerID attobj))) (setq attpt (vlax-get attobj 'InsertionPoint)) (setq blkpt (vlax-get blkobj 'InsertionPoint))); and
Pepe:
Just for comparing with plain Autolisp...
--- Code - Auto/Visual Lisp: ---(and (setq att (car (nentsel "\nSelect attribute: "))) (= "ATTRIB" (cdr (assoc 0 (entget att)))) (setq attobj (vlax-ename->vla-object att)) (setq blkobj (cdr (assoc 330 (entget att)))) (setq attpt (vlax-get attobj 'InsertionPoint)) (setq blkpt (cdr (assoc 10 (entget blkobj))))); and
Regards.
HasanCAD:
Thanks Grrr1337
Thanks Pepe
both solutions are working perfect.
Navigation
[0] Message Index
Go to full version