Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

iLogic How add to sheets names size of accordant sheet

dimamazutaMMJ32
Advocate

iLogic How add to sheets names size of accordant sheet

dimamazutaMMJ32
Advocate
Advocate

Hello!

I have drawing with sheets of different sizes.

ActiveSheet.Size give me size of the active sheet and i can't use this command in all cases.

Сan I add the size to the name of the accordant sheets?

 

0 Likes
Reply
Accepted solutions (1)
612 Views
4 Replies
Replies (4)

A.Acheson
Mentor
Mentor
Are you looking to get all sheet sizes in a sheet collection and do the following:
 
  • show the size in the title block or in the drawing as text? 

  • Or do you want to put the sheet size into the sheet name? 

    Below is a simple loop through the sheets displaying sheet size.
oDrawDoc = ThisApplication.ActiveDocument
 
    For Each oSheet in oDrawDoc.Sheets 
oSheet.Activate
MessageBox.Show(ActiveSheet.Size, "Title")
Next
If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes

dimamazutaMMJ32
Advocate
Advocate
I want to add the sheet size to his name in browser of the sheets.
For example:
01-03 Central plate (A3)
01-03 Central plate (A4)
ActiveSheet.Size writes size of active sheet in all sheets
0 Likes

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi @dimamazutaMMJ32 

 

here is a quick example.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

 

 

oSheets = ThisApplication.ActiveDocument.Sheets

' Loop thru the sheets
For Each oSheet In oSheets
	oName = oSheet.name
	
	'get only left of the :
	oSplit = Split(oName, ":")
	oName = oSplit(0)
	
	'get only left of the (
	oSplit = Split(oName, "(")
	oName = oSplit(0)
	
	'get only left of the )
	oSplit = Split(oName, ")")
	oName = oSplit(0).Trim		

	If oSheet.size = 9993 Then
		oSize = " (A0)"
	ElseIf oSheet.size = 9994 Then
		oSize = " (A1)"
	ElseIf oSheet.size = 9995 Then
		oSize = " (A2)"
	ElseIf oSheet.size = 9996 Then
		oSize = " (A3)"
	ElseIf oSheet.size = 9997 Then
		oSize = " (A4)"
	Else
		oSize = ""
	End If
	
	oSheet.Name = oName & oSize 
Next

 

 

 

 

 

 

Just for reference:

 

DrawingSheetSizeEnum Enumerator

Description

Drawing Sheet Sizes supported by Inventor.

Methods

Name Value Description
k12x18InDrawingSheetSize 9999 12 in x 18 in (typically for architectural drawings).
k18x24InDrawingSheetSize 10000 18 in x 24 in (typically for architectural drawings).
k24x36InDrawingSheetSize 10001 24 in x 36 in (typically for architectural drawings).
k30x42InDrawingSheetSize 10003 30 in x 42 in (typically for architectural drawings).
k36x48InDrawingSheetSize 10002 36 in x 48 in (typically for architectural drawings).
k9x12InDrawingSheetSize 9998 9 in x 12 in (typically for architectural drawings). Default page orientation is Portrait.
kA0DrawingSheetSize 9993 A0 size (typically for metric units).
kA1DrawingSheetSize 9994 A1 size (typically for metric units).
kA2DrawingSheetSize 9995 A2 size (typically for metric units).
kA3DrawingSheetSize 9996 A3 size (typically for metric units).
kA4DrawingSheetSize 9997 A4 size (typically for metric units).
kADrawingSheetSize 9987 A size (typically for inch units).
kBDrawingSheetSize 9988 B size (typically for inch units).
kCDrawingSheetSize 9989 C size (typically for inch units).
kCustomDrawingSheetSize 9986 Custom size. Does (may) not fit one of the standard sizes.
kDDrawingSheetSize 9990 D size (typically for inch units).
kDefaultDrawingSheetSize 9985 Specifies the default setting. The more strongly typed value is the one returned in a query.
kEDrawingSheetSize 9991 E size (typically for inch units).
kFDrawingSheetSize 9992 F size (typically for inch units).
0 Likes

dimamazutaMMJ32
Advocate
Advocate
Yes, it works perfect! Thank you!