Change Offset Programatically

Change Offset Programatically

jainn
Advocate Advocate
690 Views
1 Reply
Message 1 of 2

Change Offset Programatically

jainn
Advocate
Advocate

Dera All,

 

Actually while drawing pipe from revit i am able to change offset(Ex. from 15 to 16). but unable to change create pipe pointer location.

 

 

 

original.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Regards

Namit

0 Likes
691 Views
1 Reply
Reply (1)
Message 2 of 2

rosalesduquej
Alumni
Alumni

Hi Namit,

 

Welcome to Autodesk Answer Day.

 

Have you checked the SetOffset method ? It got introduced in 2014 API. I believe this is what you are looking for. 

http://revitapisearch.com/html/3e4004c6-618f-2450-5b4e-a9767b5f5735.htm 

 

AnalyticalModel.SetOffset Method

Sets the offset of the analytical model at end.

 

// Extend the analytical model by 1 foot at each end. 
// Direction of offset is parallel to the analytical model curve.
AnalyticalModel model = familyInstance.GetAnalyticalModel(); Curve curve = model.GetCurve(); XYZ tangentDirection0 = curve.ComputeDerivatives(0, true).BasisX.Normalize().Negate(); XYZ tangentDirection1 = curve.ComputeDerivatives(1, true).BasisX.Normalize(); model.SetOffset(AnalyticalElementSelector.StartOrBase, tangentDirection0); model.SetOffset(AnalyticalElementSelector.EndOrTop, tangentDirection1);

Cheers,



Jaime Rosales D.
Sr. Developer Consultant
Twitter | AEC ADN DevBlog
0 Likes