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.???
Solved! Go to Solution.
Solved by Joe.Ye. Go to Solution.
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.