Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

change location of a solid body from one point to another point

Pioneer
Pioneer

Hello, 

I want to move solid body from its absolute location to another selected point. I tried to use Translate method. But body changes its location not correctly. How can I do that? 

component.Translate(new3dvectorpoint- absolutelocation.translation)
4 REPLIES 4

Re: change location of a solid body from one point to another point

Legend
Legend

Luisy,

have you tried 

component.Translate(new3dvectorpoint)

?

Witalij

Re: change location of a solid body from one point to another point

Pioneer
Pioneer

@Witalij ,

 

I tried Translate method but, I am confused to use it. For example, two vectors I have component.Absolutelocation.Translation =P=(x0,y0,z0), and Q=(x1,y1,z1). I want to move vector P to position Q. What parameter should  I give in Translate method?

Re: change location of a solid body from one point to another point

Legend
Legend

@Luisy ,

 

I would try to use Q vector as parameter.

The exact description of the methos from API reference: 

"This method changes the object transformation, by applying the translation vector to the translation represented by the matrix. This method does not change the rotation and mirror information."

Re: change location of a solid body from one point to another point

Siemens Legend Siemens Legend
Siemens Legend

Hi,

The API has a limitation where you can't set a property of a property. You'll need to use the AbsoulteLocation property with the new value.

Component.AbsoulteLocation=new Txtransformation(...)