Could anybody help me with this one please?
I am currently applying dimensions/constraints to our company logo with a view to creating an ifeature which we can insert at different scales across a range of products.
I am looking at creating a user parameter for scale (value of 1) which I can then assign to all other parameters as *scale. Problem is the total number of parameters concerned is scary so I am looking for a quick way to do this.
Any ideas?
Solved! Go to Solution.
Solved by ekinsb. Go to Solution.
They are not so scarry if you export them and edit the xml with notepad or something similar where you can do a search replace.
Here's a small VBA macro you can try. It assumes the name of the parameter controlling the scale is "Scale".
Public Sub SetScaleOnParameters() Dim partDoc As PartDocument Set partDoc = ThisApplication.ActiveDocument Dim partDef As PartComponentDefinition Set partDef = partDoc.ComponentDefinition Dim modelParam As ModelParameter For Each modelParam In partDef.Parameters.ModelParameters ' Check to see that this parameter defines a distance. If partDoc.UnitsOfMeasure.CompatibleUnits("1", modelParam.Units, "1", "in") Then ' Change the expression to include scale. modelParam.Expression = modelParam.Expression & " * Scale" End If Next End Sub
Hmm. It's late, but I think, I've found an issue. Not all linear parameters are changed after applying Scale. See attached screenshots.
Parameters d16 and d39 are changed to (lh / 3 oE) - topthk * Scale, but should be (lh / 3 oE) * Scale - topthk * Scale. oE is German impression for ul = unitless.
Walter
Walter Holzwarth