Drawing Scale Adaptivity

Drawing Scale Adaptivity

Anonymous
Not applicable
933 Views
13 Replies
Message 1 of 14

Drawing Scale Adaptivity

Anonymous
Not applicable

Hi, I hope this is a simple one...I have a model of our product and I am trying to make an adaptable drawing file with iLogic so that no matter how big or small this product gets, it will always take up AROUND the same space on an 8.5x11 sheet of paper (I want the scale in whole numbers). The model can vary tremendously (if it gets so big it can barely be seen on 8.5x11 ill deal with that issue later).To avoid giving too much information which may confuse the matter, ill leave it at that.

 

I am using Inventor 2016 on Windows 7

 

Any help on this will be really appreciated!

 

Thanks

Sandro

0 Likes
Accepted solutions (1)
934 Views
13 Replies
Replies (13)
Message 2 of 14

BrandonBG
Collaborator
Collaborator

http://forums.autodesk.com/t5/inventor-customization/infinite-loop-when-re-scaling-drawing-view-from...

 

This might get you started. You'll need to compare the size of the drawing view to the size of the sheet.

 

Brandon

 

 

Message 3 of 14

Anonymous
Not applicable
Thanks for the response,
I have no idea how to use API, although your last comment in that thread seems to be the way to go. however, from look at that, it seems to me that the physical drawing view border will always be the same size which then would make the scale some type of crazy fractional number. I am understanding this correctly?
I would prefer the scale be a whole number but to be honest we send out all of our drawings with a NTS (Not to Scale) message...

Thanks
Sandro
0 Likes
Message 4 of 14

Anonymous
Not applicable
btw, that link for some reason doesn;t work. I had to type into the search bar "infinite loop...."
0 Likes
Message 5 of 14

BrandonBG
Collaborator
Collaborator

https://forums.autodesk.com/t5/inventor-customization/infinite-loop-when-re-scaling-drawing-view-fro...

 

Corrected link above.

 

If you want to avoid crazy decimal scales (1:88.122123... or something), you can establish the scale, and then round it to a whole number using the math functions inside iLogic.

 

https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2015...

 

Brandon

 

 

Message 6 of 14

Anonymous
Not applicable

Again thanks for the response!

 

Yes after thinking about it a little bit I figured that I could just use the "floor" or "ceil" functions to round it. I still am having trouble trying to figure this out. These iLogic rules for drawings seem very different to me and I can't seem to figure it out. 

 

I'll try to start small. I have a VIEW that is a certain height and width. I am ALWAYS going to use the 8.5X11 sheet of paper. If I want my view to be say 80% of the sheet height, what is the correct coding to do this?

 

The best I can come up with is this...

 

SyntaxEditor Code Snippet

 ActiveSheet.View("Elevation").Height = ActiveSheet.Height / 0.8

I am sure this is definitely not the correct way to do this but I am inexperienced with this. I also get an error saying that the drawing height parameter is "read only".

 

Anyways i seriously appreciate your help!!!

 

Thanks

Sandro 

0 Likes
Message 7 of 14

Anonymous
Not applicable
Update!!
I think I have figured it out! I used this formula. Can you please check it?

ActiveSheet.View("Elevation").Scale = (ActiveSheet.View("Elevation").Scale*((ActiveSheet.Height*0.7)/(ActiveSheet.View("Elevation").Height))

70% happened to work better for me hence the "0.7". This seems to work so I'm not sure what you might check...although I do still have that "whole number" problem. I tried putting "ceil" in front of that function and all it did was make the scale 1:1 which is wayyy too big considering using this formula made my scale 0.03 : 1. Any thoughts?

Thanks
Sandro
0 Likes
Message 8 of 14

BrandonBG
Collaborator
Collaborator

Ceil will round to an integer, so to get around that, you could multiply your calculated scale by 100. Then use Ceil and divide by 100.

 

You need to decide what is an acceptable scale. 3:100 is probably ok, but 2.987464:100 is not, right?

 

Brandon

Message 9 of 14

Anonymous
Not applicable
you are absolutely right. even though the scale in the "edit view" window is rounded, I dont like the idea that in reality it is 2.934263465.

I am a little confused by your method to get around that. Could you please write out my code with that method input in it?

I really appreciate your help!
Thanks
Sandro
0 Likes
Message 10 of 14

Anonymous
Not applicable
ok so i understand your method now lol...

I gave it a try and i didn't notice a change which i guess actually probably means it worked! i did this...
ActiveSheet.View("Elevation").Scale = (Ceil((ActiveSheet.View("Elevation").Scale*((ActiveSheet.Height*0.7)/(ActiveSheet.View("Elevation").Height)))*100)/100)

The only problem I see with this is that my scale reads 0.09:1
Im sure that the 0.09 is not rounded and is an exact number now but I would much rather see 9:100 as the scale rather than 0.09:1

Is there a way to do that?

Thanks
Sandro
0 Likes
Message 11 of 14

BrandonBG
Collaborator
Collaborator
Accepted solution

 

ActiveSheet.View("Elevation").Scale = (Ceil((ActiveSheet.View("Elevation").Scale*((ActiveSheet.Height*0.7)/(ActiveSheet.View("Elevation").Height)))*100)/100) 

ActiveSheet.View("Elevation").ScaleString = ActiveSheet.View("Elevation").Scale*100 & ":100"

I didn't test this. What happens?

Brandon

Message 12 of 14

Anonymous
Not applicable
i got an error saying "End of statement expected"
0 Likes
Message 13 of 14

Anonymous
Not applicable
actually not sure what happened the first time. I tried it again and it does exactly what I want!!I am going to have to sit here and figure out exactly what you did but that is perfect! You have no idea how much this helps me now and for the future..this is amazing!

Thanks!!
Sandro
0 Likes
Message 14 of 14

BrandonBG
Collaborator
Collaborator

DrawingView.Scale is a Double object with a mathematically determined value while DrawingView.ScaleString is just a string of characters. So, the Scale still hold is true value, but the displayed scale as a string is a workaround to get it to do what you want.

 

Inventor does this by default. You may use a 1:100 scale in a drawing, but Inventor thinks of it as .01.

 

Brandon

0 Likes