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: 

ProfileVIew objects in drawing

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
theEntity
532 Views, 3 Replies

ProfileVIew objects in drawing

Hello, 

Can anyone please tell me if it is possible to get all the Profile View objectIDs that is currently in the drawings?

-WITHOUT prompting a user for selection.  I want a objectIDcollection for all the profileviews.

 

I think this lacking in the api but any help would be appreciated.

 

3 REPLIES 3
Message 2 of 4
Jeff_M
in reply to: theEntity

A couple of way s I can think of off the top of my head.

1. Use a filtered selection set and  Autodesk.AutoCAD.EditorInput.Editor.SelectAll(Autodesk.AutoCAD.EditorInput.SelectionFilter)

 

2. Run through all of the alignments in the drawing and get the ProfileViewIds from them with Autodesk.Civil.DatabaseServices.Alignment.GetProfileViewIds()

 

 

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 4
Partha.Sarkar
in reply to: theEntity

And here is a C# code snippet using GetProfileViewIds() -

 

// Get the Aligments

ObjectIdCollection

alignments = civilDoc.GetAlignmentIds();

 

foreach

(ObjectId alignmentId in alignments)

{

 

Alignment alignment = alignmentId.GetObject(OpenMode.ForRead) asAlignment;

 

ObjectIdCollection profileViewIdColl = alignment.GetProfileViewIds();

 

// do what you want here

 

}

 

Hope this hekps !

 

Cheers,

Partha



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Message 4 of 4
theEntity
in reply to: theEntity

that is perfect. 

 

I was thinking I have to iterate through ALL the objects to check if

typeof (obj) is  Autodesk.Civil.DatabaseServices.ProfileView and it would take too long.

 

Thanks so much for the help.

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

Post to forums  

Rail Community


Autodesk Design & Make Report