Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Inventor Drawing // How to display Custom Sheet Size in Title Block

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
pierre.masson
1773 Views, 3 Replies

Inventor Drawing // How to display Custom Sheet Size in Title Block

How can I display the values of my custom sheet size in my Drawing title block ???

 

If I define a custom Size, then "Custom Size mm or in" appears in the title block.

Pierre Masson Product Support Specialist PS MFG EMEA Autodesk, Inc.
3 REPLIES 3
Message 2 of 4

Here’s a small Ilogic Solution. This one is not based on Iproperties, but on prompted entries.

This is more flexible if you have multiple drawing sheet.

 

 

First you need to create a custom Title block named CustomSheet. Instead of having <Sheet size>  as sheet property in the title block, you need to place another Text box with prompted entry (that I named “Format”).

 

Then you can create a new Ilogic Rule like that :

 

Dim odrawdoc As DrawingDocument

odrawdoc = ThisApplication.ActiveDocument

 

startsheet = ActiveSheet.Name

 

For i = 1 To odrawdoc.Sheets.Count

 

oname =odrawdoc.sheets.item(i).Name

 

ActiveSheet = ThisDrawing.Sheet(oname)

 

ActiveSheet.SetTitleBlock("CustomSheet", odrawdoc.sheets.item(i).Width & "x" &  odrawdoc.sheets.item(i).Height)

 

 

Next i

 

InventorVb.DocumentUpdate()

 

ActiveSheet = ThisDrawing.Sheet(startsheet)

 

 

 

This will implement your title block in all your drawing pages, with the size of your page in mm or in.

You can trigger this event each time you save your drawing for example.

Pierre Masson Product Support Specialist PS MFG EMEA Autodesk, Inc.
Message 3 of 4

Please pay attention, the values

 

odrawdoc.sheets.item(i).Width and height are given in CM.

 

You will need to adapt it to you units. 

Pierre Masson Product Support Specialist PS MFG EMEA Autodesk, Inc.
Message 4 of 4

Hi All

 

Based on some feedbacks I had, I did a more complete Rule.

 

You still need to create a custom Title block named CustomSheet. Instead of having <Sheet size>  as sheet property in the title block, you need to place another Text box with prompted entry (that I named “Format”).

 

The rule will scan through the pages and only if you have a custom sheet size, it will load the new titleblock. The Sheet Dimensions will be based on the units you are using in your documents. We are only using mm or Inches, you would need to adapt the code if you want to use other units.

 


DimodrawdocAsDrawingDocument

odrawdoc=ThisApplication.ActiveDocument
startsheet=ActiveSheet.Name


Fori=1Toodrawdoc.Sheets.Count
oname=odrawdoc.sheets.item(i).Name
ActiveSheet=ThisDrawing.Sheet(oname)


IfActiveSheet.Size="Custom"Then

uom=ThisDoc.Document.UnitsOfMeasure
If(uom.LengthUnits=UnitsTypeEnum.kMillimeterLengthUnits)Then
Dimension=Round(odrawdoc.sheets.item(i).Width*10,2)&"x"&Round(odrawdoc.sheets.item(i).Height*10,2)
ActiveSheet.SetTitleBlock("CustomSheet", Dimension&" mm")

ElseIf(uom.LengthUnits=UnitsTypeEnum.kInchLengthUnits)Then
Dimension=Round(odrawdoc.sheets.item(i).Width*0.3937,2)&"x"&Round(odrawdoc.sheets.item(i).Height*0.3937,2)
ActiveSheet.SetTitleBlock("CustomSheet", Dimension&" in")

Else
MsgBox("Units of Documents not recognized, it must be either mm or Inches. No Change in Titleblock will be performed")
GotoLBL
EndIf

EndIf




Nexti

InventorVb.DocumentUpdate()


LBL:
ActiveSheet=ThisDrawing.Sheet(startsheet)

 

Pierre Masson Product Support Specialist PS MFG EMEA Autodesk, Inc.

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

Post to forums  

Autodesk Design & Make Report