View Full Version : Attach Attribute to Linework
mflure.80520
2005-01-05, 12:35 AM
Greetings all,
I remember sometime ago either a LISP routine or a express tool that would allow me to attach a attribute to linework in a drawing. I would like to use it as a method of extracting truss counts/ types from my framing plans to a schedule of somekind. For some reason I can't find anything anywhere on the subject. Please help if you can.
Thanks in advanced.
Michael
RobertB
2005-01-05, 01:03 AM
You cannot "attach" an attribute, but you can use XData or an Extension Dictionary to store non-graphical data to objects such as lines.
mflure.80520
2005-01-05, 05:12 AM
Ok, My next quesiton can XData or Extension Dictionary be visable within the drawing. IE as a label for a secondary use. I can sort of use a attributed block to do what I want to do but all of the trusses are variable length and width.
Michael
RobertB
2005-01-05, 05:37 AM
No. XData and Extension Dictionaries are non-graphical data attached to the object. However, you can get complicated and use graphical callout objects linked by reactor to the original object. This would be a significant coding effort.
kennet.sjoberg
2005-01-05, 07:39 AM
If You can convert the "linework" in peces to block, You can add attributes.
: ) Happy Computing !
kennet
MHultgren
2005-01-05, 03:27 PM
Here's an option you might try. Create your attributed block and "attach" it to the trusses by using groups. or use a nested block for your attributes maybe. Using this approach, you would need to insert it and then Explode it once to get the lines to extend but still have the attributes available. Just throwing out thoughts on the subject.
peter
2005-01-07, 01:49 PM
If you want to add a hyperlink that just displays text you could attach information that when the item is highlighted and you hover the cursor over the object it would display its value.
The second routine will return a list of all hyperlink URL's on an object that is passes to this function.
Hope it helps
Peter Jamtgaard
(defun C:AddHyper (/ intCount
colHyperlinks
entSelection
objHyperlink
objSelection
ssSelections )
(princ "\nSelect object to add hyperlinks: ")
(setq ssSelections (ssget (list (cons 0 "*line"))))
(setq strHyperlinkName (getstring "\nEnter hyperlink description: "))
(repeat (setq intCount (sslength ssSelections))
(setq intCount (1- intCount)
objSelection (vlax-ename->vla-object
(ssname ssSelections intCount))
colHyperlinks (vla-get-hyperlinks objSelection)
)
(vl-catch-all-apply 'vla-add
(list colHyperlinks strHyperlinkName)
)
)
(princ)
)
(defun GetHyperLink (objSelection / lstHyperLinks)
(if (= (type objSelection) 'ENAME)
(setq objSelection (vlax-ename->vla-object objSelection))
)
(setq colHyperlinks (vla-get-hyperlinks objSelection))
(if (> (vla-get-count colHyperlinks) 0)
(vlax-for objHyperlink colHyperlinks
(setq lstHyperLinks (cons (vla-get-URL objHyperlink) lstHyperLinks))
)
)
lstHyperLinks
)
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.