Creating Section view

Creating Section view

ebo134
Advocate Advocate
952 Views
3 Replies
Message 1 of 4

Creating Section view

ebo134
Advocate
Advocate

Hi, everyone

When I created Section View  it gave me an exception of type Text saying that there is incorrect parameter, my code is:

double[] origin = new double[2];

origin[0] = bp.X;

origin[1] = bp.Y;

string strn =""; 

 

AeccSectionViewStyle asvs = g_civil3ddoc.SectionViewStyles[0]

AeccSectionViewBandStyleSet bandstyle = g_civil3ddoc.SectionViewBandStyleSets[0];

foreach (AeccSampleLine asam inslg.SampleLines)

{

   strn ="sv "+asam.Name; 

       asam.SectionViews.Add(strn, "0", origin, asvs, bandstyle);

      origin[0] += 500;

}

while bp is a selected point (point3d type), anyone can help me

 

 

thanks

0 Likes
Accepted solutions (2)
953 Views
3 Replies
Replies (3)
Message 2 of 4

Jeff_M
Consultant
Consultant
Accepted solution

Two things, the origin must provide X, Y, and Z values. And the origin must be passed as an (object):

 

double[] origin = new double[3];
origin[0] = bp.X;
origin[1] = bp.Y;
origin[2] = 0.0;
string strn ="";  

AeccSectionViewStyle asvs = g_civil3ddoc.SectionViewStyles[0];
AeccSectionViewBandStyleSet bandstyle = g_civil3ddoc.SectionViewBandStyleSets[0];
foreach (AeccSampleLine asam inslg.SampleLines)
{
   strn ="sv "+asam.Name; 
       asam.SectionViews.Add(strn, "0", (object)origin, asvs, bandstyle);
      origin[0] += 500;
}

 

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 3 of 4

ebo134
Advocate
Advocate
Accepted solution

Thank you so mutch Jeff, you'r the savior.

0 Likes
Message 4 of 4

Jeff_M
Consultant
Consultant

You're welcome. Now if you could mark my post as the solution instead of yours... 🙂

 

If you find a response which answers your question, please be sure to accept the actual post which helped you as the solution. This will help future searchers quickly find answers to their own questions. Thanks!

Jeff_M, also a frequent Swamper
EESignature
0 Likes