Cancel
Showing results for
Did you mean:

# SolidWorks positional constraint

Experimenter

Hi All,

I need some help understanding how a SolidWorks contraint is translated within Rulestream?

My Case:

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 xLoc, yLoc, zLoc, xRot, yRot, zRot As Double

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"

X="0.508"

Y="-0.0635"

Z="0.0254"

XR="0.0174532925199433"

YR="-0.0159339005156423"

ZR="0.00712237559697071" />

If someone can help, that would be really appreciated.

Regards,

Wajih

4 REPLIES 4

# Re: SolidWorks positional constraint

Community Manager

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.

# Re: SolidWorks positional constraint

Valued Contributor

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.

# Re: SolidWorks positional constraint

Experimenter

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.

Thank you

Wajih

# Re: SolidWorks positional constraint

Experimenter
Firstly thank you for your response and secondly sorry for a response so late, I was directed onto a different project. Unfortunately I cannot further test my original code, as I used patterns as suggested by Bob's suggestion below.