Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mleader and block Attributes

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
503 Views, 5 Replies

Mleader and block Attributes

I have been able to access and edit attribute values in blocks, in the past. But I am quite stumped about how to get the block attribute values out of a block inside an mleader. Actually I am quite stumped as to how to access anything inside a multi-leader if it isn't in the object dump.
Can anyone offer any suggestions about how to do this. Thanks in advance.
I have attached a zip file with a block and an mleader with block.
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

This is what I have been able to do so far, but to no avail. I have able to see the attribute values using the DXF codes, but I really don't know how to access and them. You have to have AutoCAD 2008. You can use the DXF lisp code to look at all the DXF codes available. Maybe the vla-get and vla-put has spoiled me from learning how to access the different entities. Does anyone have any suggestions? I have attached a 2008 drawing and the zip file that has my attempts and successes.
Message 3 of 6
Anonymous
in reply to: Anonymous

No one knows how to do this?
-r
Message 4 of 6
H.vanZeeland
in reply to: Anonymous

Hi

It is not the solution but you can try this

(defun c:test(/ OBJ:MAIN_ENTITY OBJ:SUB_ENTITY)
(if (and (/= (setq OBJ:MAIN_ENTITY (car (entsel "\nSelect: "))) nil)
(= (cdr (assoc 0 (setq OBJ:SUB_ENTITY (entget OBJ:MAIN_ENTITY)))) "MULTILEADER"))
(alert (vl-princ-to-string
(setq result (vl-remove nil (mapcar '(lambda(x)(if (and (= (car x) 302)(/= (cdr x) "LEADER{"))(cdr x))) OBJ:SUB_ENTITY)))))
)
(princ result)
(princ)
)

Look at the MLeaderStyle Context Data Group Codes
171 Text Attachment
296 HasBlock

and
Common MLeaderStyle Group Codes
177 Block Attribute Index
44 Block Attribute Width
302 Block Attribute Text String


Even i could find it in activeX code

Cheers
Harrie
Message 5 of 6
Anonymous
in reply to: Anonymous

Hey ther Harrie,
Thanks for the code. I just haven't ever used Mapcar or Lambda. I am still learning how to use those. right now getting that information is what I needed. However, what I was really hoping was to learn how to use the:

getblockattributevalues
setblockattributevalues

listed in the help files. they don't have any examples in the hlep files and I haven't successfully been able to implement them. I think that is what I mean by using the activex code.

Thanks for the code though.

-russ
Message 6 of 6
Anonymous
in reply to: Anonymous

It looks like I finally got this to work. I still think there is a better way to get the attribute definition object id number though. This code could probably be refined a bit, but it finally works for me.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost