Get Label / Text boundingbox (width/height) from SharedParam on Viewsheet

Get Label / Text boundingbox (width/height) from SharedParam on Viewsheet

Graham.Haigh
Participant Participant
1,084 Views
3 Replies
Message 1 of 4

Get Label / Text boundingbox (width/height) from SharedParam on Viewsheet

Graham.Haigh
Participant
Participant

I am hoping some can point me in the right direction, i have a Titleblock with a number of Labels on these labels are ultimately populated by sharedparamaters. I am wondering is it possible given a particular viewsheet to get the boundingbox (i assume it is the boundingbox) of the Label? e.g. when editing the Titleblock i am after the area defined by the blue rectangle

 

2020-04-09_11-16-22.jpg

 

Realistically i am after the width and height of that area define by the blue box, i thought i could get the boundingbox from the Parameters ElementID but that doest appear to work.

 

m.thanks

0 Likes
1,085 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk
0 Likes
Message 3 of 4

Graham.Haigh
Participant
Participant

Thank you for the links ive been down a rabbit hole trying to figure out where the element is that i want but i cant quite see how i get to it. If i edit my Title block i can snoop on the Selected object e.g. in the example below its Client and i can see all the properties that im after

 

image.png

 

 

 

 

 

 

 

 

 

 

 

If i then call GetElement on the document object with the same elementID i get nothing returned i am assuming that is because i need to ask the Titleblock/Family for this element rather than the document object

 

0 Likes
Message 4 of 4

Graham.Haigh
Participant
Participant

Well i completely overlooked i was in the Family editor when i was snooping so i would need to do something along these lines to access the Textelement  

 

        Dim fInst As FamilyInstance = doc.GetElement(New ElementId(632736))
        Dim fm As Family = fInst.Symbol.Family
        Dim fmDoc As Document = doc.EditFamily(fm)

        Dim f1 = fmDoc.GetElement(New ElementId(635802))

 

0 Likes