Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
manu.marjanen
639 Views, 4 Replies

Drawing sheet:1 and sheet:2 views scaling using Ilogic

How to write code as simply as possible.

To this drawing document "Sheet1"  "VIEW1" scale is "Parameter1" and

"Sheet2" "VIEW2" scale is "Parameter2" 

 

 

mcgyvr
in reply to: manu.marjanen

Dim oDwgDoc As Document
oDwgDoc = ThisApplication.ActiveDocument 'the current document

Dim oSheet As Sheet 
oSheet = oDwgDoc.Sheets.Item(1) 'first sheet
Dim oView As DrawingView
oView = oSheet.DrawingViews.Item(1) 'first base view sheet 1
oView.Scale = Parameter1 'set drawing scale to parameter 1


oSheet2 = oDwgDoc.Sheets.Item(2) 'second sheet
Dim oView2 As DrawingView
oView2 = oSheet2.DrawingViews.Item(1) 'first base view sheet 2
oView2.Scale = Parameter2 'set drawing scale to parameter 2


-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
manu.marjanen
in reply to: mcgyvr

Is this possible to do using names?
Sheet.Item(1) = "Sheet:1"
View.Item(1) = "View:1"



A.Acheson
in reply to: manu.marjanen

Yes for the most part replacing the  number with the label name is possible. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
A.Acheson
in reply to: A.Acheson

@manu.marjanen  The solved solution is the code posted by @mcgyvr

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