Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5892

Weird dimension python script

$
0
0

@Yang_Cao wrote:

Hi, I want to add the dimension on "front"plane, the height from the center(center of gravity) to the left bottom corner(basepoint) of the box. I used the following python script.

centerofgravity = x, y, z+gz  #the coordinate of the center of gravity
basepoint = x,y,z                  #the coordinate of the basepoint
Dimpoint = x,y,z+0.5*gz  #let the dimension in the middle of the height.

#since the dimension will be inserted on YZ plane, I try to rotate it to XZ plane
obj = rs.AddLinearDimension( centerofgravity, basepoint, Dimpoint )
if obj:
point = Dimpoint
if point: rs.RotateObject(obj, point, 90, (0,0,1), copy=False)

But it appears to be 0, like in the picture. Does anyone know why this happens?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5892

Trending Articles