It is currently Sun May 19, 2013 4:37 am

All times are UTC





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: VBA drawing sheet size
PostPosted: Thu Oct 02, 2008 2:48 pm 
Offline
MCAD Lurker

Joined: 07 Jun 2005
Posts: 9
I have a question on how to find the sheet format size using vba?

I have not used Inventor for several years but i remember how poor the documentation is by autodesk regarding api commands.

ANdrew


Share on FacebookShare on TwitterShare on DiggShare on DeliciousShare on TumblrShare on Google+
Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 02, 2008 3:42 pm 
Offline
MCAD Addict
User avatar

Joined: 22 Mar 2004
Posts: 530
Country: United States
State: Pennsylvania
CAD System: Inventor
A simple example....
Code:
Public Sub GetSheetSize()

Dim invAllSheets As Sheets
Dim invSHEET As Sheet
Dim invDrawDoc As DrawingDocument

'drawing document must be active...
'remember that all linear dims are returned in centimeters
'regradless of document settings...
    Set invDrawDoc = ThisApplication.ActiveDocument
    Set invAllSheets = invDrawDoc.Sheets
    For Each invSHEET In invAllSheets
        Debug.Print "Dimensions for: " & invSHEET.name
        Debug.Print "Width: " & invSHEET.Width & _
                " cm (" & CStr(invSHEET.Width / 2.54) & " Inches)"
        Debug.Print "Height: " & invSHEET.Height & _
                " cm (" & CStr(invSHEET.Height / 2.54) & " Inches)"
    Next invSHEET
   
End Sub


The help file for Inventor 2009 (admapi_13_0.chm) has more examples and "guides" than previous versions.

_________________
Robert A. Williams
http://www.leacar.com
"Gentlemen...you can't fight here. This is the War Room!"


Top
 Profile  
 
 Post subject: Reply
PostPosted: Tue Oct 07, 2008 3:33 pm 
Offline
MCAD Lurker

Joined: 07 Jun 2005
Posts: 9
Cheers for the code, it has helped me understand Inventor vba and solved my problem

Andrew


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
POWERED_BY