BrFace SubEntityPath Error
Getting an error while using BrFace SubentityPath
Steps:- I have created simple cube from CreateBox API (Solid3d)
- getting Brep and BrFace from that Solid3d
BrFace face = brp.Faces.ElementAt(5);
- Now I need SubEntityPath from face
I am getting error here..
Please suggest if I am doing anything wrong here.
0
Comments
-
First, the object must first be stored in the drawing in order to get the ObjectId. Only then can the paths to the subobjects be obtained.
Secondly, to get bRep, you should use the full path to the solid and not the solid itself, otherwise the paths to the subobjects will not be available.
/// public static Brep
/// Get Brep on FullSubentityPath. It will be possible to extract SubentityPath from all faces
/// The solid must be saved in the dwg. Otherwise, it will issue a regular Brep without SubentityPath
///
GetBrep(this Solid3d solid)
{
if (solid is null || solid.IsNull || solid.IsErased) return null;
try
{
if (solid.ObjectId.IsNull) return new Brep(solid);
ObjectId[] ids = new ObjectId[] { solid.ObjectId };
SubentityId subentId = new(SubentityType.Null, IntPtr.Zero);
return new Brep(new FullSubentityPath(ids, subentId));
}
catch (Rt.Exception) { return null; }
}0 -
Thanks! @avc
it worked!!
Is there any way to get face from blockreference (block instance on model space).
TIA.0