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: 

Drawing Page not showing anything??

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
zoe.baker-bushby
225 Views, 3 Replies

Drawing Page not showing anything??

I am using iLogic to create a new drawing sheet:

dim oDoc as DrawingDocument = ThisApplication.ActiveDocument
dim oFormat as SheetFormat
try
oFormat = oDoc.SheetFormats.Item("CNC Format")
catch
MessageBox.Show("Error: CNC Format might not exist.", "iLogic")
end try
Dim
newSheet As Sheet = oDoc.Sheets.AddUsingSheetFormat(oFormat) newSheet.Activate()

 This worked in Inventor 2022, however recently upgraded to 2024.

 

The rule does not error, instead it produced an empty workspace??

zoebakerbushby_0-1701790897702.png

 

If I Save and Close and reopen the document then the sheet is there like so:

zoebakerbushby_1-1701791040185.png

 

 

I have tried Zoom All (Home)

 

I know the scale is wrong, could this be causing the issue?

 

Any help would be appreciated, thanks 🙂

 

Labels (3)
3 REPLIES 3
Message 2 of 4

Hi @zoe.baker-bushby.  Did it create the new sheet within the active drawing?  Does the SheetFormat you are specifying contain any drawing views for a model?  If the view is getting created way bigger than the sheet, due to scaling issues, then you can try adding this line of code at the end of what you have there.

ThisApplication.ActiveView.Fit

That should cause all geometry of the active view on your screen at the time to be fitted within the active view frame.  Also, due to the way you are using the Try...Catch statement, the code will continue past that point, even if no SheetFormat was found, instead of exiting the rule, so I would probably recommend adding another line of code in there that checks if it was found, like the following:

If oFormat Is Nothing Then Return

The following is just a link to the online help documentation for that API Function.

Sheets.AddUsingSheetFormat 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 4

Rule is being run within active drawing, with the sheet being added to active drawing.

Sheet format specified does not specify any drawing views. My rule is adding the drawing view.

Tried both your suggestions, still the same outcome:

zoebakerbushby_0-1701793579175.png

 

 

Message 4 of 4

Fixed it this morning.

It does seem to have been a scale issue.

My rule is creating a detail view of a view on sheet 1, creating a new page and placing the detail view on this new page.

I was not correctly specifying the scale for this detail view, so Scale was actually left blank.

Don't understand why this would stop it from displaying a page but it did.

Something like it can't render something when it doesn't know the size of it...?

 

The rule now correctly specifies the scale when creating the detail view, and now the page shows up.

 

Thanks 🙂

 

Tags (1)

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

Post to forums  

Autodesk Design & Make Report