cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Constant variable in model relation

Newbie

Constant variable in model relation

I'm constructing a parametric group of points, by this points are defined axis, planes and whatever necessary to build solid cads, so if the points change position the solids can regenerate consequently. Facing this problem have incountered an issue: two points must rotate with a given angle around a central fixed point, with the points defined through offset by siscoo i have intrepreted this as a conversion from polar coordinates to cartesian coordinates, so written a relation that can read the radius, calculate the shift first on the longitudinal coordinates, than on the vertical coordinates and calculate the new position of the points. The issue with this approach is the radius, with the first iteration the points get a longitudinal displacement that change the radius, so with the second iteration the vertical displacement formula work with the new radius, that is wrong. Seeing the resemblance between the language of the relation interface and the C language i tried to define a constant radius variable, assigned before the code start calculating, so the radius cant change through the operation, but the sistem has not recognized the command. There is a better way to face this problem? Can i somehow define a constant variable? Where i can get a complete guide to the relation interface to understand what language i can use? Thanks for the answers, below attach a copy of my code.

 

LEGENDA:

 

SPOST_SUP_LONG= longitudinal displacement of the superior point

RAGGIO_ATTACCO_SUPERIORE= radius from center point to superior point

ANGOLO_CASTER= given angle

DIST_LONG_ATC_PORT_ANT_SUP= longitudinal coordinate of superior point

SPOST_SUP_VERT= vertical displacement of the superior point

ALT_ATC_PORT_ANT_SUP= vertical coordinate of the superior point

SPOST_INF_LONG= longitudinal displacement of the inferior point

RAGGIO_ATTACCO_INFERIORE=  radius from center point to inferior point

DIST_LONG_ATC_PORT_ANT_INF=longitudinal coordinate of inferior point

SPOST_INF_VERT= vertical displacement of inferior point

ALT_ATC_PORT_ANT_INF= vertical coordinate of inferior point

 

CODE:

 

SPOST_SUP_LONG=RAGGIO_ATTACCO_SUPERIORE*COS(ANGOLO_CASTER)
DIST_LONG_ATC_PORT_ANT_SUP=DIST_LONG_ATC_PORT_ANT_SUP+SPOST_SUP_LONG
SPOST_SUP_VERT=RAGGIO_ATTACCO_SUPERIORE*SIN(ANGOLO_CASTER)
ALT_ATC_PORT_ANT_SUP=ALT_ATC_PORT_ANT_SUP+SPOST_SUP_VERT
SPOST_INF_LONG=RAGGIO_ATTACCO_INFERIORE*COS(ANGOLO_CASTER)

DIST_LONG_ATC_PORT_ANT_INF=DIST_LONG_ATC_PORT_ANT_INF-SPOST_INF_LONG
SPOST_INF_VERT=RAGGIO_ATTACCO_INFERIORE*SIN(ANGOLO_CASTER)

ALT_ATC_PORT_ANT_INF=ALT_ATC_PORT_ANT_INF-SPOST_INF_VERT

Announcements