Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

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

manu.marjanen
Advocate

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

manu.marjanen
Advocate
Advocate

How to write code as simply as possible.

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

"Sheet2" "VIEW2" scale is "Parameter2" 

 

 

0 Likes
Reply
Accepted solutions (1)
640 Views
4 Replies
Replies (4)

mcgyvr
Consultant
Consultant
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
0 Likes

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



0 Likes

A.Acheson
Mentor
Mentor
Accepted solution

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
0 Likes

A.Acheson
Mentor
Mentor

@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
0 Likes