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: 

Copy Profile

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Civil3DReminders_com
594 Views, 6 Replies

Copy Profile

Is there an easy way to copy a design (layout) profile? Or does one have to go through the PVIs or Entities collection and recreate it? 

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
6 REPLIES 6
Message 2 of 7

Can you use this build in function: https://knowledge.autodesk.com/support/civil-3d/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/Civi...

 

Or do you mean copy by code?

Message 3 of 7

I mean by code. 

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 4 of 7

The Clone() method (inherited from RXObject) seems to create an exact copy of the profile under the same master alignment without duplicating anything unwanted from what I can see.

Message 5 of 7
Jeff_M
in reply to: tyronebk

@tyronebk did you do anything special to get that to work? I can see, when stepping through the code, that it appears the Profile is cloned successfully, but once completed there is no new profile in the drawing.

Jeff_M, also a frequent Swamper
EESignature
Message 6 of 7

You also need to add the profile to the Database, like you would any AutoCAD object that is cloned, and also change the name of the profile (Civil 3D doesn't throw any errors, but this breaks the pattern). 

 

I don't think I'm going to use this method since I feel it might lead to some broken stuff later on.

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 7 of 7

Sorry @Jeff_M, as Chris mentions, you need to change the name and add it to modelspace after cloning.

 

@Civil3DReminders_com I've used the Clone() method on a number of C3D objects and never had any ongoing issues. That said, there is the potential for issues when a parent object is cloned, as the children sometimes become confused about the parent object.

 

The case where this has proven to be the most challenging is cloning a corridor with a surface attached, the surface somehow belongs to both corridors (luckily it can be removed from one of the corridors and remain attached to the other one).

 

In my test drawing, I've attached reference labels, projection objects, offset profile, and corridors to the profile prior to cloning and haven't run into any issues with the children becoming confused. As far as I can tell, it behaves exactly like a profile created using the AutoCAD COPY command and I've never run into an issue using that approach but YMMV.

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report