create section view

create section view

anhtrung
Advocate Advocate
1,266 Views
9 Replies
Message 1 of 10

create section view

anhtrung
Advocate
Advocate

Hi everybody. I'm creating section view with .NET but i don't find Style and Band Set to add sectionview. Can every body help me do it? Thanks.

0 Likes
Accepted solutions (1)
1,267 Views
9 Replies
Replies (9)
Message 2 of 10

Jeff_M
Consultant
Consultant
I believe that the Create method uses the Styles set in the CreateSectionview settings. SO either change those to what you want to use before creating the SectionView, or set the styles for the SV after you create it.
Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 3 of 10

flycoflyco
Enthusiast
Enthusiast
Accepted solution
ObjectId svid = SectionView.Create("SectionView" + indexNum.ToString(), index, new Point3d(insertPosition.X + (indexXnum * 500), insertPosition.Y - (indexNum * 200), 0));
scv = ts.GetObject(svid, OpenMode.ForWrite) as SectionView;
SectionViewBandSet SctVwBndSet = scv.Bands;
0 Likes
Message 4 of 10

anhtrung
Advocate
Advocate

Hi flycoflyco. I have a create Sectionview but i can't set style for sectionview it. Have you method do it?

0 Likes
Message 5 of 10

Jeff_M
Consultant
Consultant

@anhtrung are you saying that

 

scv.StyleId = SectionViewStyleToUse.ObjectId;

or 

scv.StyleName = SectionViewStyleToUse.Name;

 

don't work for you?

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 6 of 10

anhtrung
Advocate
Advocate

@Jeff_M I have add Style into Sectionview but that make erro. I don't know how it?

0 Likes
Message 7 of 10

anhtrung
Advocate
Advocate

I have create SectionView from to code below:

 

ObjectId _o = SectionView.Create(l.ToString(), _id, _3d);
SectionView sect = tr.GetObject(_o, OpenMode.ForWrite) as SectionView;
ObjectId _band = _doc.Styles.SectionViewBandSetStyles[_Band];
sect.Bands.ImportBandSetStyle(_band);
SectionViewBandSet _set = sect.Bands;

 

But when i select Change Band Set so appear message box must to choose Band Set and then i have choose style Band Set style but program automatic close. I don't know make it how to do that, so can eyverybody help me, Please. I have send File below:

Untitled.png

2.png

 

 

0 Likes
Message 8 of 10

Jeff_M
Consultant
Consultant
Please post your full code to test with, thanks!
Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 9 of 10

anhtrung
Advocate
Advocate

I send my code see below, can you help me. Thanks.

0 Likes
Message 10 of 10

Jeff_M
Consultant
Consultant
OK, yes, I get the same error after using your code. But then I restarted C3D and attempted to change the band set in an already existing sectionview group and received the same fatal error. So this appears to affect base C3D2016, SP2, (which is what I am testing in) and is not necessarily something wrong with your code.
Jeff_M, also a frequent Swamper
EESignature
0 Likes