Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Set Corridor StyleName is giving exception

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
431 Views, 4 Replies

Set Corridor StyleName is giving exception

Hi,

I am creating new corridor, but while doing it, I want to set its Object Style Name on Properties->Information tab through API : public virtual string StyleName { get; set; }

 

Please refer following code snippet,

               string styleName = m_selectedCorridor.StyleName;
               m_newCorridor.StyleName = styleName;
 
But here I am getting exception as "need to override property StyleName."
Please guide me to resolve this exception.


Thanking you for all your help,
Mahesh

Tags (1)
4 REPLIES 4
Message 2 of 5
augusto.goncalves
in reply to: Anonymous

Sorry the Corridor.StyleName is not implemented on the Corridor class, only the default base Entity implementation that throws this exception.

I would suggest your get the Corridor.StyleId and open the respective Style (CorridorStyle) and get its name.
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 3 of 5
Anonymous
in reply to: augusto.goncalves

Hi Augusto Goncalves,
As you suggested, we tried following,
corridor1.StyleId = corridor2.StyleId;
It is showing same exception as,
'System.InvalidOperationException: need to override property StyleId()'

Thanks,
Mahesh.
Message 4 of 5
Anonymous
in reply to: Anonymous

Hi Augusto,

We wanted to set StyleName / StyleId to new corridor (or existing corridor) from my plugin using API.

Thanks,
Mahesh.
Message 5 of 5
augusto.goncalves
in reply to: Anonymous

Sorry about that, but this property doesn't implement the SET method.
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report