Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add PVI to Profile Via ActiveX

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
brianchapmandesign
549 Views, 6 Replies

Add PVI to Profile Via ActiveX

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.


"Very funny, Scotty. Now beam down my clothes.
6 REPLIES 6
Message 2 of 7
Jeff_M
in reply to: brianchapmandesign

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
EESignature
Message 3 of 7
brianchapmandesign
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...


"Very funny, Scotty. Now beam down my clothes.
Message 4 of 7
Jeff_M
in reply to: brianchapmandesign

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
EESignature
Message 5 of 7
brianchapmandesign
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?


"Very funny, Scotty. Now beam down my clothes.
Message 6 of 7
Jeff_M
in reply to: brianchapmandesign

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
EESignature
Message 7 of 7
brianchapmandesign
in reply to: Jeff_M

Thanks!


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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report