get dwg sheet size without opening drawing

get dwg sheet size without opening drawing

Anonymous
Not applicable
1,180 Views
3 Replies
Message 1 of 4

get dwg sheet size without opening drawing

Anonymous
Not applicable

Is there a way, using VBA to get the sheet size of a drawing without opening the drawing?  I know how to get it with the drawing open, so alternatively, is there a way to open all the drawings in a folder, one at a time, then get sheet.size, then close and open the next?  Thanx.

0 Likes
1,181 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

For VBA I think you are stuck with opening the drawing.

You can open it invisible though.

 

But if you want to speed up things, maybe you can create a stand alone app and use apprentice to find out the sheet sizes. Apprentice is faster but verry limited (and can not be used in inventor VBA projects), so you should check whether it will support getting sheet sizes.

0 Likes
Message 3 of 4

jletcher
Advisor
Advisor

Looking at some of the code with ilogic you may be able to write a short code that can do this and make an excel file to record the findings.

 

Right now that as far as I went in the middle of a code now and I have one to do for another guy then if you still need it I can lok into it further..

0 Likes
Message 4 of 4

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

I agree RPdAnjou that Apprentice should be the best option. It event does not need to install Inventor. It is an API provided with Inventor View which is free. If you install Inventor, the Apprentice is provided as well.

 

I gave a small check just now and can confirm Apprentice supports accessing Sheet size. In addition, with developing in Visual Studio, you will have more flexibility to customize your form/dialog.

 

 ' code snippet in VB.NET
 ' display the name of the size of the first sheet in a drawing

 Dim oApp As Inventor.ApprenticeServerComponent = New ApprenticeServerComponent
 Dim oDoc As ApprenticeServerDrawingDocument = oApp.Open("c:\MyTest.idw")
 Dim oSheet As Sheet = oDoc.Sheets(1)
 MessageBox.Show(oSheet.Size.ToString())

 

0 Likes