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: 

Model Text via API

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Anonymous
893 Views, 1 Reply

Model Text via API

I am trying to manipulate Model Text via code but cannot establish the correct means to get the ModelTextType property.

 

public

Autodesk.Revit.DB.ModelTextType ModelTextType{ set; get; }

Member of

Autodesk.Revit.DB.ModelText

 

I would appreciate the code snippet if you can help

 

I guess something like

 

ModelTextType modelType =  current document.modeltexttype.???

1 REPLY 1
Message 2 of 2
Joe.Ye
in reply to: Anonymous

 

Note quite clear what's the point of this question.  Do you want to get a ModelTextType object from the document? or when you get the ModelTextType from ModelText.ModelTextType property, error occurs?

 

If it is the first situation, you can use the FilteredElemetnCollector to get all the ModelTextType instances in the document via this code fragment.

 

FilteredElementCollector collector = new FilteredElementCollector(doc);

collector.OfClass(typeof(ModelTextType));

IList<Element> list = collector.ToElements();

 

All the model text types will be returned in list variable.

 

Hope this helps.

 

 



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network

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