Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get part string length

2 REPLIES 2
Reply
Message 1 of 3
urdiafa
326 Views, 2 Replies

Get part string length

I pick a element textnote " abcdefgh " in revit , It can get string " abcdefgh " length using " BoundingBoxXYZ bbox = el . Get_BoundingBox (doc . ActiveView ) " but I want to get string " abcd " length in string " abcdefgh " , How could I to get  it? Any help will appreciate .

2 REPLIES 2
Message 2 of 3
Dale.Bartlett
in reply to: urdiafa

Get the substring and then:

public SizeF MeasureString(
	string text,
	Font font
)

Maybe??

 


Dale




______________
Yes, I'm Satoshi.
Message 3 of 3
BobbyC.Jones
in reply to: urdiafa

Sounds like a good candidate for the TTT.

 

Modify the textnote to contain only the partial string, grab the length, then rollback the transaction.  I assume you'll need to regen the document between modding the text and getting the length.

--
Bobby C. Jones

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community