How to set Drawing view scale to model size within the same sheet

How to set Drawing view scale to model size within the same sheet

Anonymous
Not applicable
4,334 Views
4 Replies
Message 1 of 5

How to set Drawing view scale to model size within the same sheet

Anonymous
Not applicable

Hi,

 

I need help for to set drawings views scale to fit within the sheet, when model changed from lower value to higher value, but when higher value model to be fit within the are of lower value of the drawing view.

 

The drawing views to be adopted to same size to any size of the model.

 

Please help me as i am struck with this.

 

Thank you,

Abdul Rizwan

0 Likes
Accepted solutions (1)
4,335 Views
4 Replies
Replies (4)
Message 2 of 5

mcgyvr
Consultant
Consultant

Is this related to some ilogic or vba programming you are doing? Or just out of the box manual view placement/update functions?



-------------------------------------------------------------------------------------------
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
Message 3 of 5

johnsonshiue
Community Manager
Community Manager

Hi! Indeed, Brian is right. This needs to be done via iLogic. Inventor automatically figures out a suitable scale factor based on the model bounding box, sheet size, and the pre-defined scale values. Within the manual workflows, there isn't a way to set the scale proportional to the model size. I believe Inventor API and iLogic are needed to make it work.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 4 of 5

dutt.thakar
Collaborator
Collaborator
Accepted solution

@Anonymous 

 

Check out the below links that are available on the Inventor Customization forum.

https://forums.autodesk.com/t5/inventor-customization/automatic-scale-and-view-position/td-p/5784680

https://forums.autodesk.com/t5/inventor-customization/scaling-functionality-for-a-set-of-drawing-views/td-p/7928218

 

There are several ways of doing this, you can add equations based on your sheet and view size and view positions, you can also predefine the scales and use them etc.

 

Check out the below code as well, which I use sometimes, which does not require the scales to be set manually or via scale string function. In the below code, you just need to change the values in the fourth line (30,30) that represents an imaginary box within which the view will always be fit, you can try this rule and then it will automatically set the view in that imaginary box regardless of the size of your model. You can do some tests and fix the values(currently (30,30)) and once you are satisfied it will always work. In this you need to be aware that the scales will be set automatically so it will not follow the standards (i.e. 1:5 or 1:10 etc.) you will see quite random values in scale.

 

'This code is only for first view, you can use it for more views by modifying it.
Sub
Main Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument Dim oSheet As Sheet = oDoc.ActiveSheet Dim oView As DrawingView = oSheet.DrawingViews.Item(1) ReScale_View(oView, 30, 30) End Sub Public Sub ReScale_View (aView As DrawingView, X As Double, Y As Double) Dim XOrg As Double = aView.Width / aView.Scale Dim YOrg As Double = aView.Height / aView.Scale Dim XScale As Double = X / XOrg Dim YScale As Double = Y / YOrg aView.Scale = Math.Min(XScale, YScale) End Sub

 

Hope this will be helpful.

 

 

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
Message 5 of 5

Anonymous
Not applicable

Dear @dutt.thakar  Sir,

 

It was a wounder full solution for my exact requirement. I am very thankful to you for helping me in time.

 

Please request you to help me if anything to be required further course for any other requirement.

 

Thank you,

Abdul Rizwan

0 Likes