I need some help understanding how a SolidWorks contraint is translated within Rulestream?
I have an assembly with dynamically generated blades. I calculate the positional coordintaes and then store them in a string. The string is delimited by a "$" sign and a "," to split that string for instances and attributes respectively.
I have the following formula for a property which is used as a constraint for a SolidWorks part;
Dim bladeSet() As String
bladeSet = split(Me.MyDesign(1).DMP_BladeParameters, "$")
Dim currBlade() As String
currBlade = split(bladeSet(Me.SubPartID), ",")
Dim xLoc, yLoc, zLoc, xRot, yRot, zRot As Double
xLoc = CDbl(currBlade(0))
yLoc = CDbl(currBlade(1))
zLoc = CDbl(currBlade(2))
xRot = CDbl(currBlade(3))
yRot = CDbl(currBlade(4))
zRot = CDbl(currBlade(5))
Result = RS_CAD_Position("SolidWorks", Me, xLoc, yLoc, zLoc, xRot, yRot, zRot)
Now; when I look at the first instance, the individual values extracted using the split as follows;
xLoc = 20
yLoc = 7.88
zLoc = -2.5
xRot = 1
yRot = -0.91294
zRot = 0.40808
but then I look as the result of this property in RS Engineer I see the following;
<Constraint type="FIXPOSITION" idpath1="54246"
If someone can help, that would be really appreciated.
Solved! Go to Solution.
I'll ask some of the guys on the team to take a look, but something to keep in mind. . .
Units can be tricky. If you setup a Rulestream database in meters but then work with Solidworks parts that are in inches you will have difficulties keeping units straight within formulas (my personal experience).
In the example you provide, the units of length appear to be converted to meters.
Ex. xLoc = 20
If we assume that's 20in, this equates to .508m, what you show further down with X="0.508"
The yLoc and zLoc in your example don't match up quite as well so I can only hope you copied them incorrectly into your entry.
I.e. yLoc=7.88in is 0.2001m, zLoc=-2.5in is -0.635m
The angular values in your example are being converted from degrees to radians.
1 degree = 0.0174 radian
We had a similar issue with blades located rotationally around a center point in a SolidWorks assembly. We took advantage of driving one blade in the SolidWorks assembly then using SolidWorks patterning to pattern them around a center point. Rulestream drives the blade sizing and the SolidWorks pattern feature.
Sorry for responding so late, but I was pulled into a much larger project.
As for your solution, I ended using the same solution as you mentioned, Rulestream drove my primary blade and then I patterned the primary blade. Ofcourse I had multiple primary blades therefore each primary had a pattern.
And all patterns were driven by Rulestream.