Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing drawing sheet numbers

2 REPLIES 2
Reply
Message 1 of 3
treavie
3469 Views, 2 Replies

Changing drawing sheet numbers

Hi,

 

As above is there a way to set a drawing template to start at a different sheet number than 1?
So overwrite the sheet property so that it starts at, say, 26 and increments that way?
This is for large contracts that require 150 or so pages that can be worked on by more than one person without a large file size.

1 person would have 1 to 25, one would have 26 to 50 etc.

 

I have achieved this already by saving the drawing as a dwg file and opening in autocad. Adding in text on every sheet with a field text link to the model space - "Sht. # of #".

 

This works but I am hoping there is a simpler solution.

 

Thanks

2 REPLIES 2
Message 2 of 3
santoshr0114
in reply to: treavie

Kindly post this in Inventor General Section if this is not related to Customization.

I hope you know and aware that you can link iProperties and also custom properties to the IDW.
You can have a custom title block template and add iproperty parameters which represents Sheet Number.

When this template is used automatically the Number is extracted from the Model Iproperty and added as sheet number in your IDW.

Hope this helps....

Regards
Santosh
Message 3 of 3
treavie
in reply to: santoshr0114

Hi,

 

Just giving an update if anyone stumbles across this.

I knew about linking iProperties but I needed a property that would be variable across every sheet or would need to create a lot of iProperties.

I was hoping that there was a simple override for Sheet numbering to start at a number other than one but this doesnt seem to be the case.

 

Instead I used an iLogic routine to create a text box on every page and populated it with input parameters. This works well but is not adaptive - cannot change the sheet numbering without deleting the box and starting again.

 

This is the thread that I got the text box creation help here.

 

Also below I have posted my final code that I use. I am aware it is propably a bit rough but I am new to this and it does everything I want.

 

'setting up document/sheets etc
Dim oDrawDoc As DrawingDocument
     oDrawDoc = ThisApplication.ActiveDocument
	Dim oSheets As Sheets 
	oSheets = ThisDoc.Document.sheets
	Dim oSheet As Sheet
	Dim startsheet As Integer
	Dim endsheet As Integer
	Dim numsheets As Integer
	Dim tblock As String
	Dim tborder As String
	Dim tsize As String
'getting user inputs for the sheet number to start at, the total number of sheets and the amount of sheets in this file
	startsheet = InputBox("Sheet to start drawing at", "Sheet Numbering")
	endsheet = InputBox("Total number of sheets in drawing","Sheet Numbering")
	numsheets = InputBox("Number of sheets in this file","Sheet Numbering")
'set i = to the sheet number to start at and get the titleblock/border etc for the first sheet (so all sheets are identical)
	i = startsheet
	tblock=ActiveSheet.TitleBlock
	tborder=ActiveSheet.Border
	tsize=ActiveSheet.Size
'create the number of sheets needed
createsheet:	If oDrawDoc.Sheets.Count <numsheets Then
				ThisApplication.ActiveDocument.Sheets.add ()
				Goto createsheet
				End If
'loop through every sheet and add in text that is formatted to a certain size
For Each oSheet In oSheets
	oSheet.activate
    Dim oGeneralNotes As GeneralNotes
     oGeneralNotes = oSheet.DrawingNotes.GeneralNotes    
    Dim oTG As TransientGeometry
     oTG = ThisApplication.TransientGeometry
    Dim sText As String
    sText = "Sht "& i &" of "& endsheet
    Dim sFormattedText As String
	sFormattedText = "<StyleOverride FontSize = '0.35'>" & sText & "</StyleOverride>"
	Dim oGeneralNote As GeneralNote
	oGeneralNote = oGeneralNotes.AddFitted(oTG.CreatePoint2d(37.5, 3), sFormattedText)
	i=i+1
		
Next
'loop through every sheet and set titleblocks/borders etc

	i=startsheet
For Each oSheet In oSheets
	oSheet.activate
	ActiveSheet.TitleBlock = tblock
	ActiveSheet.Border = tborder
	ActiveSheet.ChangeSize(tsize, MoveBorderItems := True)
'loop through and rename sheets to the new sheet numbering	oSheet.Name = "Sheet" &  i
	i=i+1
Next
'goto first sheet
ActiveSheet = ThisDrawing.Sheet("Sheet" & startsheet & ":1")

 Thanks,

 

Tom

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

Post to forums