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: 

Create sheet format with options

1 REPLY 1
SOLVED
Reply
Message 1 of 2
drafter2ZT9Z4
196 Views, 1 Reply

Create sheet format with options

drafter2ZT9Z4
Contributor
Contributor

Hello, I'm trying to use ilogic to create a sheet format but I want to enable the option of FitViewsToSheet.

 

Does anyone know how to accomplish this?

0 Likes

Create sheet format with options

Hello, I'm trying to use ilogic to create a sheet format but I want to enable the option of FitViewsToSheet.

 

Does anyone know how to accomplish this?

1 REPLY 1
Message 2 of 2

Andrii_Humeniuk
Advisor
Advisor
Accepted solution

Hi @drafter2ZT9Z4 . You need to use the AddWithOptions method and add the FitViewsToSheet setting to it. Example code:

 

Dim oDDoc As DrawingDocument = TryCast(ThisDoc.Document, DrawingDocument)
If oDDoc Is Nothing Then Exit Sub
Dim oOptions As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap
Call oOptions.Add("FitViewsToSheet", True)
Dim oSheetF As SheetFormat = oDDoc.SheetFormats.AddWithOptions(oDDoc.ActiveSheet, "NewSheetFormat", oOptions)

Valid values are: Name = “FitViewsToSheet”, Value = Boolean

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes

Hi @drafter2ZT9Z4 . You need to use the AddWithOptions method and add the FitViewsToSheet setting to it. Example code:

 

Dim oDDoc As DrawingDocument = TryCast(ThisDoc.Document, DrawingDocument)
If oDDoc Is Nothing Then Exit Sub
Dim oOptions As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap
Call oOptions.Add("FitViewsToSheet", True)
Dim oSheetF As SheetFormat = oDDoc.SheetFormats.AddWithOptions(oDDoc.ActiveSheet, "NewSheetFormat", oOptions)

Valid values are: Name = “FitViewsToSheet”, Value = Boolean

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

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

Post to forums  

Autodesk Design & Make Report