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
Solved! Go to Solution.
Solved by gazadder. Go to Solution.
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)
Thankyou for your post/code gazadder! Exactly what I needed- saved me a bunch of time!
May your Kudos overflow.
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!