AutoCAD Civil 3D Customization

Reply
Distinguished Contributor
area51visitor
Posts: 116
Registered: ‎03-05-2011
Message 1 of 7 (111 Views)
Accepted Solution

Add PVI to Profile Via ActiveX

111 Views, 6 Replies
08-24-2011 12:18 PM

Shouldn't it be as simple as:


(vlax-invoke-method profileobj 'add station elevation 0)

 

0 being tangent... if that's correct

 

not sure why this won't work.

- Brian
"Very funny, Scotty. Now beam down my clothes."
*Expert Elite*
Jeff_M
Posts: 4,194
Registered: ‎07-22-2003
Message 2 of 7 (105 Views)

Re: Add PVI to Profile Via ActiveX

08-24-2011 12:48 PM in reply to: area51visitor

It won't work because there is no Add method for Profiles.

 

It also won't work if the Profile is Dynamic, so check this property before going too far.

 

A Profile object has a PVIS property.

 

The AeccProfilePVIs objects has an Add method, and also has an AddMultiple method.

From the C3D2010 help:

Adds a PVI to the collection and optionally places a vertical curve at that PVI.

HRESULT Add(
[in] double Station, 
[in] double Elevation, 
[in] AeccProfilePVICurveType CurveType, 
[in, optional] VARIANT Param1, 
[in, optional] VARIANT Param2, 
[out, retval] IAeccProfilePVI** pPVI
);
Parameters
Parameters
Description
Station
Station value for the new PVI.
Elevation
Elevation value for the new PVI.
CurveType
Type of curve to place at the new PVI.
Param1
See the remarks section.
Param2
See the remarks section.
pPVI
Returns the new PVI.
Remarks

For a line, Param1 and Param2 are unused. For a circular arc, Param1 is the radius. Param2 is unused. For a symmetric parabola, Param1 is the curve length. Param2 is unused. For an asymmetric parabola, Param1 and Param2 are the two tangent lengths used to define the entity. 

Jeff_M, also a frequent Swamper
Distinguished Contributor
area51visitor
Posts: 116
Registered: ‎03-05-2011
Message 3 of 7 (101 Views)

Re: Add PVI to Profile Via ActiveX

08-24-2011 01:09 PM in reply to: Jeff_M

Roger that... sorry typed that in on a wim....

 

that was supposed to be the PVIS object...

 

must just be my station elevation tangent formatting...

- Brian
"Very funny, Scotty. Now beam down my clothes."
*Expert Elite*
Jeff_M
Posts: 4,194
Registered: ‎07-22-2003
Message 4 of 7 (101 Views)

Re: Add PVI to Profile Via ActiveX

08-24-2011 01:57 PM in reply to: area51visitor

This may work...no time to test though.

 

(vlax-invoke-method profilepvis 'add station elevation 1 nil nil)

 

The 1 is the Enum equal for AeccProfilePVICurveType.aeccProfileTangent and the 2 nil's are for the optional values that aren't used with the Tangent type but still must have a placeholder for them.

Jeff_M, also a frequent Swamper
Distinguished Contributor
area51visitor
Posts: 116
Registered: ‎03-05-2011
Message 5 of 7 (92 Views)

Re: Add PVI to Profile Via ActiveX

08-24-2011 05:02 PM in reply to: Jeff_M

Always appreciate the words of wisdom, it worked, of course...it came from you.

 

How do I identify the enum for the tangent like you posted?

- Brian
"Very funny, Scotty. Now beam down my clothes."
*Expert Elite*
Jeff_M
Posts: 4,194
Registered: ‎07-22-2003
Message 6 of 7 (91 Views)

Re: Add PVI to Profile Via ActiveX

08-24-2011 05:50 PM in reply to: area51visitor

I used C3D2010, started a new VBA project, added the AeccLand references, then used the immediate window like so:

? AeccProfilePVICurveType.aeccProfileTangent

 

and it returned 1. Using this with the .aeccProfileArc returns 2.

 

I used 2010 because I don't need/want to use the VBA add-in for 2011-2012. 

 

There is a way to do this in VLisp, and I used to do it with the LDT libraries, but this seems to be one of those things I have completely forgotten how to do. I even searched through some of my old lisps for the code but was unsuccessful. This then would allow the activeX enums to be not only evaluated, but actually used in your lisp code.

Jeff_M, also a frequent Swamper
Distinguished Contributor
area51visitor
Posts: 116
Registered: ‎03-05-2011
Message 7 of 7 (89 Views)

Re: Add PVI to Profile Via ActiveX

08-24-2011 06:11 PM in reply to: Jeff_M

Thanks!

- Brian
"Very funny, Scotty. Now beam down my clothes."

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