(API) Lines to bars converter addin

(API) Lines to bars converter addin

Rafal.Gaweda
Autodesk Support Autodesk Support
1,418 Views
3 Replies
Message 1 of 4

(API) Lines to bars converter addin

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi

 

Lines to bars converter addin attached.

 



Rafal Gaweda
1,419 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Hi Rafal,

 

Would you mind sharing the script for this? I'd like to adapt it for export data from Grasshopper.

 

Thanks,

Andrew

Message 3 of 4

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @Anonymous 

 

Have fun

 

                    if (Obj.Main.GetGeometry().Type == IRobotGeoObjectType.I_GOT_POLYLINE)
                    {

                        RobotGeoPolyline PlineGeometry = (RobotGeoPolyline)Obj.Main.GetGeometry();
                        RobotGeoSegmentCollection Segments = (RobotGeoSegmentCollection)PlineGeometry.Segments;

                        for (int ii = 1; ii <= Segments.Count - 1; ii++)
                        {


                            RobotGeoSegment S1 = Segments.Get(ii);
                            RobotGeoSegment S2 = Segments.Get(ii + 1);
                            int SN = ST.Nodes.FreeNumber;
                            ST.Nodes.Create(SN, S1.P1.X, S1.P1.Y, S1.P1.Z);
                            int EN = ST.Nodes.FreeNumber;
                            ST.Nodes.Create(EN, S2.P1.X, S2.P1.Y, S2.P1.Z);
                            ST.Bars.Create (ST.Bars.FreeNumber, SN, EN);
                        }
                    }


Rafal Gaweda
Message 4 of 4

w.milewski2WYJN
Contributor
Contributor

Genialne i bardzo przydatne. Dlaczego tego nie ma w programie?

0 Likes