Custom Command for several tasks (read below)

Custom Command for several tasks (read below)

AlphabetABC
Contributor Contributor
1,143 Views
12 Replies
Message 1 of 13

Custom Command for several tasks (read below)

AlphabetABC
Contributor
Contributor

Hi Everyone,

 

I have to repeat several steps to clean up Civil 3D drawing and make them readable on regular AutoCAD.

 

These drawings have Xrefs, sometimes a lot of them, and the process that I am following is this one:

 

  1. Copy each Xref  in a new folder
  2. Open the main drawing and change the path of each Xref to the new folder
  3. Open each Xref and start cleaning with:
    • Audit - y
    • Purge - a and Purge - r
    • Change - All - P - E - 0
  4. Qselect  - Line - Start / End Z to 0
  5. Qselect  - Polyline
  6. Qselect  - Arc

Now I need to make this process faster with a macro, and so far I was able to write the code till step 3:

 

^C^C_audit;y;-purge;a;*;n;-purge;r;*;n;_change;ALL;;P;E;0;;

 

Does anyone have any idea on how to continue?

 

Also, is it possible to create a command that I can start on the main drawing and automatically repeats these steps for each Xref?

 

Thank you in advance!

 

0 Likes
1,144 Views
12 Replies
Replies (12)
Message 2 of 13

john.vellek
Alumni
Alumni

Hi marco.pedaletti,

 

While it looks like you have a good start on your script, have you considered using the Action Recorder to create a macro. It looks like it would be really well suited to this issue.

 

Please hit the Accept as Solution button if my post fully solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 3 of 13

TheCADnoob
Mentor
Mentor

Would you be able to Bind the xrefs and then purge and use something like exporttoautocad? or does it not clean them up enough.

CADnoob

EESignature

0 Likes
Message 4 of 13

AlphabetABC
Contributor
Contributor

Unfortunately you are right, it does not clean it up enough.

 

Thank you

0 Likes
Message 5 of 13

john.vellek
Alumni
Alumni

Hi @AlphabetABC,

 

Do you have the Civil 3D Object Enabler installed? Perhaps that will make a difference in your process.

 

Please feel free to attach a sample drawing as well so I can take a look.

 

Please hit the Accept as Solution button if my post fully solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 6 of 13

AlphabetABC
Contributor
Contributor

Hi John,

 

Yes I have it, but my client probably does not.

 

Sorry but I'm not allow to attach the drawing.

 

Thank you,

 

Marco

0 Likes
Message 7 of 13

gdefilo
Advocate
Advocate

Hi marco.pedaletti,

have you considered the "flatten" command? It modifies the Z coordinate of entities floating in space.

You can find it in the Express Tools Menu.

It works on 2D entities and 3D polylines. But also blocks and hatches. It will not work on entities in blocks.

 

Hope this helps,

Giancarlo

 

 

0 Likes
Message 8 of 13

AlphabetABC
Contributor
Contributor

Hi Giancarlo,

 

That command sometimes creates problems, that's why we go through the steps mentioned before.

 

Thank you

0 Likes
Message 9 of 13

gdefilo
Advocate
Advocate

Well,

have a look at this, then:

http://forums.autodesk.com/t5/autocad-2010-2011-2012/how-to-globally-change-all-z-values-to-0/td-p/3...

 

Be sure to read all of the thread.

 

Hope this helps,

Giancarlo

 

0 Likes
Message 10 of 13

john.vellek
Alumni
Alumni

Hi @AlphabetABC,

 

I am checking back to see if my post or others helped you with your problem. Please add a post with your results so other Forum users can benefit.

Please hit the Accept as Solution button if a post or posts fully solved your issue or answered your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 11 of 13

AlphabetABC
Contributor
Contributor

Hi John,

 

I am still trying to fix the method that I am currently using, I'm open to more options and I'm trying to use all the info received so far to make it better.

 

As soon as it works as I want, I'll create a new post.

 

Thank you,

 

Marco

0 Likes
Message 12 of 13

john.vellek
Alumni
Alumni

Thanks Marco, 

 

Again, I would be happy to look at one of the subject files in order to offer you any other possible solutions.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 13 of 13

john.vellek
Alumni
Alumni

Hi @AlphabetABC,

 

In your first post, since you can't change Elevation in the Properties command, I think you would need a lisp routine to filter for Z values of each entity so you could set them to 0.

 

I used to have one called NEWZ.lsp  - I will try to see if I have a copy but there are likely more modern and better ones in the Customization forum.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes