Change section view style in .NET

Change section view style in .NET

tranmanh1992
Contributor Contributor
1,207 Views
3 Replies
Message 1 of 4

Change section view style in .NET

tranmanh1992
Contributor
Contributor

Hi, want to change the style for my section view base on StyleID or StyleName

but I got the error message: " need to override property StyleId()"

Here is my code: 

using (Transaction civiltr = ObjectID.Database.TransactionManager.StartTransaction())
{

CivilEntity obj = civiltr.GetObject(ObjectID, OpenMode.ForWrite) as CivilEntity;

/// Tried with /// SectionView obj = civiltr.GetObject(ObjectID, OpenMode.ForWrite) as SectionView ; ( not work also) //////
obj.StyleId = StyleID;

/// also tried with obj.StyleName too //////

civiltr.Commit();
}

 

 

Thanks

0 Likes
Accepted solutions (1)
1,208 Views
3 Replies
Replies (3)
Message 2 of 4

Jeff_M
Consultant
Consultant
Accepted solution
Unfortunately Autodesk seems to think that we don't need to change the style used by some C3D entities. SectionViews and Parcels come to mind. Corridors used to have this issue but this was corrected in recent releases.
Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 3 of 4

tranmanh1992
Contributor
Contributor

Thanks for the info.

0 Likes
Message 4 of 4

Civil3DReminders_com
Mentor
Mentor

Worse, the SectionViewGroups.Add doesn't use the DrawingSettings for the Section View Style. 

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
0 Likes