Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change Drawing scale with iLogic upon parameter change

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Kris_Inv2013
4326 Views, 4 Replies

Change Drawing scale with iLogic upon parameter change

Hi All,

 

I wonder if somene could help me out on this one?

 

I have a spreadsheet and iLogic driven mater assy to generate different iterations.

 

I would like to change the scale of a base view on a drawing based on a parameter in my assembly. The idea is to get iLogic to change the view using a simple If / Else statement.

 

This is what I tried:

 

If Parameter("0 Generic Assembly v2.2.iam.BP") < 1570 Then 
ActiveSheet.View("VIEW1").Scale = 1/8
Else
ActiveSheet.View("VIEW1").Scale = 1/10
EndIf

So basically the value of "BP" parameter (excel parameter in my assy) would drive the scale of the views. But its not working.

 

Is it actully a sensible method? Can I use in the drawing enironment the excel parameters in my assembly?

 

This is the rror message I get when the rule is run:

"Error in rule: View Scale, in document: 0 Generic Assembly v2.2.idw

Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))"

 

 

Also using the same thinking I use iLogic to populate the drg number field on the drawing based on an excel parameter. The rule works but does not always updayes the drawing no upon the parameter change or update/rebuild commands.

 

 

Any comment is greatly appreciated.

 

 

Kris 

4 REPLIES 4
Message 2 of 5
F.Goncalves
in reply to: Kris_Inv2013

Im trying to do the same your doing here. Did you managed to make it work?
Thanks!
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
--
F.Goncalves
Message 3 of 5
gazadder
in reply to: Kris_Inv2013

Try the below method which works for me. The scale is set by dimensions.

 

'Below makes the view visible
ActiveSheet.View("TOP_VIEW").View.Suppressed = False

'Below takes the overall dimensions from my assembly. My sheet size is A3 and the numbers represent mm for the maximum size of the view I want.
SCALE_1 = 260/Parameter("ASSEMBLY.iam.WIDTH")
SCALE_2 = 100/Parameter("ASSEMBLY.iam.LENGTH")

'Below determins the smallest value so the maximum limits are not exceded.
ActiveSheet.View("TOP_VIEW").Scale = Min(SCALE_1, SCALE_2)

'Below positions the view in the centre of by drawing sheet.
ActiveSheet.View("TOP_VIEW").SetCenter(centerX + 215, centerY + 160)

 

 

 

Message 4 of 5
forbillian
in reply to: gazadder

Thankyou for your post/code gazadder! Exactly what I needed- saved me a bunch of time!

May your Kudos overflow.

 

Message 5 of 5
F.Goncalves
in reply to: forbillian

I made an ilogic code that might work for you. It scales the view without any parameter...

give it a try and let me know how it works for you!

http://forums.autodesk.com/t5/inventor-general-discussion/automatic-scale-and-view-position/m-p/5784...

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
--
F.Goncalves

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report