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: 

Error creating material name using prohibited characteres

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
457 Views, 2 Replies

Error creating material name using prohibited characteres

Creating new material using "prohibited characteres" gives the attached error.

.api_error.png

Strange thing is that when creating material names in Revit the software accepts the name. Is there a workaround this error??

Thank you all for the attention

 

2 REPLIES 2
Message 2 of 3
jeremytammik
in reply to: Anonymous

Same answer as always:

 

Perform the task manually in the user interface.

 

You say that works fine.

 

Look at the result via the API access by using RevitLookup.

 

See how the result that worked is represented in the API.

 

Problem solved.

 

You could also use the debugger and numerous other tools to see what the manually generated result looks like from the API point of view.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 3
Revitalizer
in reply to: Anonymous

Hi,

 

you could use NamingUtils.IsValidName(string name) to check the proposed name before trying to assign it.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





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