cancel
Showing results for 
Search instead for 
Did you mean: 

SolidWorks positional constraint

Experimenter
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 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"

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

Re: SolidWorks positional constraint

Community Manager Community Manager
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.

 

1 degree = 0.0174 radian

Re: SolidWorks positional constraint

Creator
Creator

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
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
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.