Robot API query

Robot API query

Anonymous
Not applicable
539 Views
3 Replies
Message 1 of 4

Robot API query

Anonymous
Not applicable

What is the line of code to be used in the C# code for Robot API to decide, if the contour defined using polyline is to define a Panel or an opening.

0 Likes
540 Views
3 Replies
Replies (3)
Message 2 of 4

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @Anonymous

 

Opening is a contour inside panel and it is not meshed

Example code below

 

Dim Robject As RobotObjObject
Dim Rcontour As New RobotGeoContour
Dim Segment(4) As New RobotGeoSegmentLine
   

Segment(1).P1.Set 0, 0, 0
Rcontour.Add Segment(1)

Segment(2).P1.Set 10, 0, 0
Rcontour.Add Segment(2)

Segment(3).P1.Set 10, 0, 5
Rcontour.Add Segment(3)

Segment(4).P1.Set 0, 0, 5
Rcontour.Add Segment(4)

        
Rcontour.Initialize

        DrawPanel = RobApp.Project.Structure.Objects.FreeNumber
        Set Robject = RobApp.Project.Structure.Objects.Create(DrawPanel)
        Robject.Main.Geometry = Rcontour
        Robject.Main.Attribs.Meshed = True
        Robject.Initialize
        Robject.Update
        
Dim Ocontour As New RobotGeoContour

Segment(1).P1.Set 1, 0, 1
Ocontour.Add Segment(1)

Segment(2).P1.Set 2, 0, 1
Ocontour.Add Segment(2)

Segment(3).P1.Set 2, 0, 2
Ocontour.Add Segment(3)

Segment(4).P1.Set 1, 0, 2
Ocontour.Add Segment(4)

Ocontour.Initialize

        DrawOp = RobApp.Project.Structure.Objects.FreeNumber
        Set Robject = RobApp.Project.Structure.Objects.Create(DrawOp)
        Robject.Main.Geometry = Ocontour
        Robject.Initialize
        Robject.Update
        

 

 



Rafal Gaweda
0 Likes
Message 3 of 4

Anonymous
Not applicable

Hello Rafael;

 

My situation is as follows.

 

To create panel or opening, polyline method has been used. In the polyline option we can define the contour to create panel or openings.

 

 

Capture.PNG

 

My program chooses all the contours from the model and treats them as Panel.

But I want to know which contour has been used to define panel and which one to define Contour/Opening.

I have written the API in C# and want to know which option I should use in my code get the information I am looking for.

 

 

 

0 Likes
Message 4 of 4

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @Anonymous

 

If I understood you correctly, polyline or any set of lines, arcs which are used to create panel \ opening are "converted" by program to contours while creating panels \ openings.

So I guess you need to check whether the Robject.Main.Attribs.Meshed is True or  False



Rafal Gaweda
0 Likes