Hi @DVanQuyet
There is no Direct method to convert the direct shape to Solid. We can use Element.getGeometry(option) method.
though iteration process From GeometryElement to GeometryObject -->we can able to find the SOLID.
Please check the below Code for additional reference.
Options opt = new Options();
opt.ComputeReferences = true;
GeometryElement element = directShape.get_Geometry(opt);
Solid solid = null;
foreach (GeometryObject obj in element)
{
if (obj is Solid)
{
solid = obj as Solid;
}
}
Hope This Helps!!!
HI @DVanQuyet
Try to get DirectShape Element from outside the transaction by using its ElementId or Element Name.
Or Can you send me your code snippet?
So that i can check why null is returned.
Hi @DVanQuyet
For this Case My Suggestion :),
Check with the Revit Lookup, After creating or selecting the DirectShape.
Hi @DVanQuyet
If your problem is solved, Please accept it as a solution, In the future, it may be easy for other people facing same
problem.
Thank you so much... 🙂