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: 

iLogic to exclude sheets from count/ printing

4 REPLIES 4
Reply
Message 1 of 5
JACKW5PE3
102 Views, 4 Replies

iLogic to exclude sheets from count/ printing

JACKW5PE3
Enthusiast
Enthusiast

I am trying to automate a drawing document to turn off sheets according to which configuration the assembly/ parts are. The problem is when I exclude a sheet from the count it will change the order of sheets after that one. 

 

If anyone knows of a solution to this or if there is a better way of doing what im trying to acheive please let me know. Am I better off supressing/ enabling views instead of exlcuding from count/ printing?

 

And then to disable the exclude the count/ printing on a sheet that is already excluded from the count, how am i supposed to do this? because the code needs the sheet number in its code to know which one to modify this option.

 

A simple example of program that returns with errors below. and attached .idw file.

 

ThisDoc.Document.Sheets.Item("Sheet:1").ExcludeFromPrinting = True
ThisDoc.Document.Sheets.Item("Sheet:1").ExcludeFromCount = True

ThisDoc.Document.Sheets.Item("Sheet:2").ExcludeFromPrinting = True
ThisDoc.Document.Sheets.Item("Sheet:2").ExcludeFromCount = True

ThisDoc.Document.Sheets.Item("Sheet:3").ExcludeFromPrinting = True
ThisDoc.Document.Sheets.Item("Sheet:3").ExcludeFromCount = True

ThisDoc.Document.Sheets.Item("Sheet:4").ExcludeFromPrinting = True
ThisDoc.Document.Sheets.Item("Sheet:4").ExcludeFromCount = True

ThisDoc.Document.Sheets.Item("Sheet:5").ExcludeFromPrinting = True
ThisDoc.Document.Sheets.Item("Sheet:5").ExcludeFromCount = True

ThisDoc.Document.Sheets.Item("Sheet:6").ExcludeFromPrinting = True
ThisDoc.Document.Sheets.Item("Sheet:6").ExcludeFromCount = True

 

0 Likes

iLogic to exclude sheets from count/ printing

I am trying to automate a drawing document to turn off sheets according to which configuration the assembly/ parts are. The problem is when I exclude a sheet from the count it will change the order of sheets after that one. 

 

If anyone knows of a solution to this or if there is a better way of doing what im trying to acheive please let me know. Am I better off supressing/ enabling views instead of exlcuding from count/ printing?

 

And then to disable the exclude the count/ printing on a sheet that is already excluded from the count, how am i supposed to do this? because the code needs the sheet number in its code to know which one to modify this option.

 

A simple example of program that returns with errors below. and attached .idw file.

 

ThisDoc.Document.Sheets.Item("Sheet:1").ExcludeFromPrinting = True
ThisDoc.Document.Sheets.Item("Sheet:1").ExcludeFromCount = True

ThisDoc.Document.Sheets.Item("Sheet:2").ExcludeFromPrinting = True
ThisDoc.Document.Sheets.Item("Sheet:2").ExcludeFromCount = True

ThisDoc.Document.Sheets.Item("Sheet:3").ExcludeFromPrinting = True
ThisDoc.Document.Sheets.Item("Sheet:3").ExcludeFromCount = True

ThisDoc.Document.Sheets.Item("Sheet:4").ExcludeFromPrinting = True
ThisDoc.Document.Sheets.Item("Sheet:4").ExcludeFromCount = True

ThisDoc.Document.Sheets.Item("Sheet:5").ExcludeFromPrinting = True
ThisDoc.Document.Sheets.Item("Sheet:5").ExcludeFromCount = True

ThisDoc.Document.Sheets.Item("Sheet:6").ExcludeFromPrinting = True
ThisDoc.Document.Sheets.Item("Sheet:6").ExcludeFromCount = True

 

4 REPLIES 4
Message 2 of 5
A.Acheson
in reply to: JACKW5PE3

A.Acheson
Mentor
Mentor

Hi @JACKW5PE3 

It sounds like you would be better having 

a different drawing for the assembly configuration you have and keep the parts out of this drawing also. Maybe your workflow is fixed already and you can’t modify? 

A few more details of what your workflow is and the variables would help to offer more advice. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes

Hi @JACKW5PE3 

It sounds like you would be better having 

a different drawing for the assembly configuration you have and keep the parts out of this drawing also. Maybe your workflow is fixed already and you can’t modify? 

A few more details of what your workflow is and the variables would help to offer more advice. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 3 of 5
JACKW5PE3
in reply to: JACKW5PE3

JACKW5PE3
Enthusiast
Enthusiast

Drawing Setup as follows:

xxxxx-001 (assembly)

xxxxx-002 (parts list) 

 

I have all the parts on seperate sheets in xxxxx-002. I have the assembly file configurable with ilogic which suppresses/ unsupresses parts and part quantity changes.

0 Likes

Drawing Setup as follows:

xxxxx-001 (assembly)

xxxxx-002 (parts list) 

 

I have all the parts on seperate sheets in xxxxx-002. I have the assembly file configurable with ilogic which suppresses/ unsupresses parts and part quantity changes.

Message 4 of 5
jnowel
in reply to: JACKW5PE3

jnowel
Advocate
Advocate

What's your criteria for excluding the sheet from printing or count?
Maybe you can use those criteria to toggle the exclude from printing/count instead.
Something like below to get you started. that doesn't rely on the Sheet's name

edit: i can't really open the attached IDW (in 2024) so can't really see what's inside

 

Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument

For Each oSheet As Sheet In oDrawDoc.Sheets
	
	Dim oViewDoc As Document
	
	If oSheet.DrawingViews.Count = 0 Then 
		'What to do if No drawing view in Sheet
	Else
		'there's at least one drawing view on sheet
		oViewDoc = oSheet.DrawingViews(1).ReferencedDocumentDescriptor.ReferencedDocument
		If YourExclusionCriteriaIsMetBasedFromoViewDoc Then
			oSheet.ExcludeFromCount = True
			oSheet.ExcludeFromPrinting = True
		Else
			oSheet.ExcludeFromCount = False
			oSheet.ExcludeFromPrinting = False
		End If
		
	End If
	
Next

 

 

0 Likes

What's your criteria for excluding the sheet from printing or count?
Maybe you can use those criteria to toggle the exclude from printing/count instead.
Something like below to get you started. that doesn't rely on the Sheet's name

edit: i can't really open the attached IDW (in 2024) so can't really see what's inside

 

Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument

For Each oSheet As Sheet In oDrawDoc.Sheets
	
	Dim oViewDoc As Document
	
	If oSheet.DrawingViews.Count = 0 Then 
		'What to do if No drawing view in Sheet
	Else
		'there's at least one drawing view on sheet
		oViewDoc = oSheet.DrawingViews(1).ReferencedDocumentDescriptor.ReferencedDocument
		If YourExclusionCriteriaIsMetBasedFromoViewDoc Then
			oSheet.ExcludeFromCount = True
			oSheet.ExcludeFromPrinting = True
		Else
			oSheet.ExcludeFromCount = False
			oSheet.ExcludeFromPrinting = False
		End If
		
	End If
	
Next

 

 

Message 5 of 5
WCrihfield
in reply to: JACKW5PE3

WCrihfield
Mentor
Mentor

Hi @JACKW5PE3.  I would also suggest that you should rename all of your sheets to unique, meaningful names, instead of the default "Sheet", if you need to be able to get specific sheets by code.  This action will 'stabilize' that process, so that even after you have excluded a sheet from the count, you can still access that specific sheet using the first part of its name (before ":" and the index number).  Even uniquely named sheets will still have the ":" and index number at the end of their names though, because that is managed automatically by Inventor.  And the index number will always be according to the order those sheets are in the model browser tree.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes

Hi @JACKW5PE3.  I would also suggest that you should rename all of your sheets to unique, meaningful names, instead of the default "Sheet", if you need to be able to get specific sheets by code.  This action will 'stabilize' that process, so that even after you have excluded a sheet from the count, you can still access that specific sheet using the first part of its name (before ":" and the index number).  Even uniquely named sheets will still have the ":" and index number at the end of their names though, because that is managed automatically by Inventor.  And the index number will always be according to the order those sheets are in the model browser tree.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

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

Post to forums  

Autodesk Design & Make Report