AutoCAD Civil 3D Customization

Reply
Active Contributor
ebo134
Posts: 30
Registered: ‎12-15-2010
Message 1 of 4 (159 Views)
Accepted Solution

Creating Section view

159 Views, 3 Replies
10-17-2012 10:51 AM

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

*Expert Elite*
Jeff_M
Posts: 4,192
Registered: ‎07-22-2003
Message 2 of 4 (148 Views)

Re: Creating Section view

10-17-2012 03:35 PM in reply to: ebo134

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
Active Contributor
ebo134
Posts: 30
Registered: ‎12-15-2010
Message 3 of 4 (140 Views)

Re: Creating Section view

10-17-2012 10:58 PM in reply to: Jeff_M

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

*Expert Elite*
Jeff_M
Posts: 4,192
Registered: ‎07-22-2003
Message 4 of 4 (134 Views)

Re: Creating Section view

10-18-2012 06:07 AM in reply to: ebo134

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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Civil 3D Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for AutoCAD Civil 3D helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Civil 3D

Twitter

Facebook

Blogs