Create sheet format with options

Create sheet format with options

drafter2ZT9Z4
Enthusiast Enthusiast
322 Views
1 Reply
Message 1 of 2

Create sheet format with options

drafter2ZT9Z4
Enthusiast
Enthusiast

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
Accepted solutions (1)
323 Views
1 Reply
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