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: 

Revit API - Access to Text & Label Types within Family and Projects

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
mfleming.stantec
4994 Views, 7 Replies

Revit API - Access to Text & Label Types within Family and Projects

I'm trying to add new text types and label types to a project or family.

I'm able to create new family types but I cannot access the text/label system paramters.

 

Revit 2013

 

Sorry for the noob question.

Tags (3)
7 REPLIES 7
Message 2 of 8
saikat
in reply to: mfleming.stantec

Hi

 

Does this post help: http://adndevblog.typepad.com/aec/2012/08/creating-new-textnotetype-programmatically.html

 

thanks

Saikat



Saikat Bhattacharya
Senior Manager - Technology Consulting
Message 3 of 8

Yes this will work.

I can look for the same procedure for labels and I'll be set.

 

Thanks!

Message 4 of 8
saikat
in reply to: mfleming.stantec

Glad the suggestion is helpful.

 

kinid regards



Saikat Bhattacharya
Senior Manager - Technology Consulting
Message 5 of 8
mfleming.stantec
in reply to: saikat

For Text Types this worked.

Revit API - Create Text Type

 

For Label types I had to change "TextNote" to "TextElement" and "TextNoteType" to "Symbol".

 

Project completed.

Message 6 of 8
5674829
in reply to: mfleming.stantec

I want Create a new TextElement(Label) in a Family document via API,but i found i cannot! Because i did not find a method that is similar with Document.FamilyCreate.NewTextNote,Pipe.Create. How to Create TextElement(Label)? I am looking forward to hearing from you.
Message 7 of 8
arnostlobel
in reply to: 5674829

Dear 5674829:

I have not used this method myself, but I believe you could use the NewTextNote method in both kinds of documents, because it is a method of ItemFactoryBase, which is a subclass of both Creation.Document and Creation.FamilyItemFavctory. As far as I know, it has never been possible to directly instantiate a TextElement, because that class does not have a public constructor. Only TextNote object is possible to instantiate.

Cheers
Arnošt Löbel
Message 8 of 8

Thanks for this thread. It helped me to fix my own problem, for which i needed to understand how I could update the text font of text notes as well as labels. 

 

Just for your information, a TextNote is a TextElement as well. The revit API docs says:

 

TextElement Class 
Base class representing text elements in Revit.
 
...so when you filter for TextElements you will get Labels as well as TextNotes . 
 
That said, the method that you so helpfully provided above, works for textnotes as well as labels:
 

@mfleming.stantec wrote:

 

For Label types (...) change "TextNote" to "TextElement" and "TextNoteType" to "Symbol".

 

 


So you actually don't need 2 methods but you can use 1 and the same method for both types. 
 
Cheers
 
 

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