.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

open drawing, zoom all, save drawing with new name.

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
ynapeu
260 Views, 5 Replies

open drawing, zoom all, save drawing with new name.

i have a lot of drawings.

i will open the drawing, i will make a zoom all and save it with a new name.

i have written a small example, but it doesn't work.

5 REPLIES 5
Message 2 of 6
ActivistInvestor
in reply to: ynapeu

This post and the file attached to it show one way to do batch processing of drawing files. The included example code opens each file, switches to the model tab, zooms to the extents, and then saves the file. 

Message 3 of 6
ynapeu
in reply to: ActivistInvestor

You mean these lines, unfortunately, 'Foreach' does not exist.
error CS1061: "DocumentCollection"has no Foreach......

Application.DocumentManager.ForEach(ofd.FileNames, delegate(Document doc) { doc.Editor.Command("._TILEMODE", "1"); doc.Editor.Command("._ZOOM", "_E"); doc.Save(); } );
Message 4 of 6
ActivistInvestor
in reply to: ynapeu

ForEach is an extension method that is added by the code that is attached to that post. To use it you must add the code file attached to that post to your project. 

Message 5 of 6
ynapeu
in reply to: ynapeu

If one would read the documentation, it would be half as difficult. The center point, height, and width must be specified in DCS coordinates.

Message 6 of 6
ActivistInvestor
in reply to: ynapeu


@ynapeu wrote:

If one would read the documentation, it would be half as difficult. The center point, height, and width must be specified in DCS coordinates.


I'm not sure what that has to do with not bothering to read the post I linked to, where it clearly states that the source code needed for the example code in the post was in an attached file.

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report