[.net api] contour information

[.net api] contour information

sapch
Advocate Advocate
1,875 Views
9 Replies
Message 1 of 10

[.net api] contour information

sapch
Advocate
Advocate

I want to get the 微信图片_20200910155029.png of a curved beam after cutting through a plane, such as points or curves. I tried to implement it through "imodeler" and "extensions", but there was no result in the end. Please help me!

@ChristianBlei

0 Likes
Accepted solutions (1)
1,876 Views
9 Replies
Replies (9)
Message 2 of 10

sapch
Advocate
Advocate

I want to get the contour information of a curved beam after cutting through a plane, such as points or curves. I tried to implement it through "imodeler" and "extensions", but there was no result in the end. Please help me!

0 Likes
Message 3 of 10

ChristianBlei
Advisor
Advisor
Accepted solution

Hi,

 

  • you can try to get the modellerbody of the beam (there are variations of the modellerbody for different purposes)         public Autodesk.AdvanceSteel.Modeler.ModelerBody GetModeler(Autodesk.AdvanceSteel.Modeler.BodyContext.eBodyContext bodyCtx)
    Member von "Autodesk.AdvanceSteel.ConstructionTypes.AtomicElement"
  • Then you can get the brepinfo of the modellerbody      ModelerBody.getBrepInfo(Autodesk.AdvanceSteel.Geometry.Point3d[], Autodesk.AdvanceSteel.Modeler.ModelerBody.FaceInfo[])
  • The iterate trough the faceInfos to get the sequences of the vertices for the faces.

I guess you will mget polygonal planar faces.

 

Or

 

You could check what you get if you use the IntPtr of the underlying body. My hope ids that this would return the AutoCAd Solid3D that you get when you explode the beam. Of the solid you could access the solids BREP ( you would have to reference   acdbmgdbrep.dll).

 

Good luck!

 

 

 

Christian Blei
CBT Christian Blei Tools
christianblei.de
youtube.com/channel/UCxjA_NbeScQy9C0Z1xjwXpw
0 Likes
Message 4 of 10

sapch
Advocate
Advocate

Thank you very much. @ChristianBlei 

0 Likes
Message 5 of 10

sapch
Advocate
Advocate

@ChristianBlei  The function has been implemented. Thank you very much

0 Likes
Message 6 of 10

iwafb
Advisor
Advisor

Hi @sapch ,

 

Would you be willing to share your process to achieve this?

0 Likes
Message 7 of 10

sapch
Advocate
Advocate

public void BeantBeamCutPlate()
{
UserInteraction.PrintMess("请选取梁:");
ObjectId asObjectId = UserInteraction.SelectObject();
UserInteraction.PrintMess("请选取板:");
ObjectId asObjectIdPlate = UserInteraction.SelectObject();

Polyline3d polyline = new Polyline3d();
List<Point3d> arraylist = new List<Point3d>();
List<Point3d> resP = new List<Point3d>();

using (DocumentAccess documentAccess = new DocumentAccess())
{
if (asObjectId != null)
{
Plate plate = DatabaseManager.Open(asObjectIdPlate) as Plate;
Matrix3d matrix = new Matrix3d(plate.CS);
matrix.GetCoordSystem(out Point3d ptOrt, out Vector3d vx, out Vector3d vy, out Vector3d vz);

FilerObject filerObject = DatabaseManager.Open(asObjectId);
if (filerObject != null && filerObject.IsKindOf(FilerObject.eObjectType.kBeam))
{
Beam beam = filerObject as Beam;
ModelerBody modelerBody1 = beam.GetModeler(BodyContext.eBodyContext.kNormal);
modelerBody1.IntersectWith(plate.DefinitionPlane, out LineSeg3d[] lineSeg3s);

int n = 0;
foreach (var item in lineSeg3s)
{
if (n < lineSeg3s.Length / 2)
{
arraylist.Add(item.MidPoint);
n++;
}
}

getPath(arraylist, resP, arraylist[0]);

for (int i = 0; i < resP.Count; i++)
{
polyline.Append(resP[i]);
}

PlateContourNotch plateContour = new PlateContourNotch(plate, 1, polyline, vz, vx);
plate.AddFeature(plateContour);
}
}
documentAccess.Commit();
}
}

Message 8 of 10

iwafb
Advisor
Advisor

Thanks heaps, I wasn't sure how to actually generate the shape...

0 Likes
Message 9 of 10

sapch
Advocate
Advocate

112.png

Message 10 of 10

calogero_pullara07
Contributor
Contributor

Hi @sapch ,

 

Would you be willing to share your function

getPath(arraylist, resP, arraylist[0]);

too, please?

Thanks

0 Likes