Dear All,
I am working with Microstation V8i ss3 with C#.Net. I am trying to do the conversion of solid to shape for that i used the below code
BCOM.Application app = BMI.Utilities.ComApp; BCOM.ElementEnumerator elemenum = app.ActiveModelReference.GetSelectedElements(); while (elemenum.MoveNext()) { BCOM.ElementEnumerator eleEnum = app.ActiveModelReference.GetSelectedElements(); while(eleEnum.MoveNext()) { BCOM.Element ele = eleEnum.Current; BCOM.ElementEnumerator solidEnum = app.SmartSolid.ConvertToSmartSolidElement(ele); while(solidEnum.MoveNext()) { BCOM.SmartSolidElement solidele = solidEnum.Current as BCOM.SmartSolidElement; BCOM.ElementEnumerator subenum = solidele.GetSubElements(); while(subenum.MoveNext()) { BCOM.Element subele = subenum.Current; app.ActiveModelReference.AddElement(subele); } } } }
when i am using this code i am getting all elements are line element but i need complex shape / shape element. (like output of drop Element: solids To Surfaces).
any one give me the idea to do this.
Thanks and Regards,
Karthik Mahalingam
Hi Karthik,
I recommend to move your question to MicroStation Programming forum.
karthik m said:when i am using this code i am getting all elements are line element
I did not test it, but it makes sense: SmartSolid is persisted (stored in DGN format) as cell with specific structure, using B-rep representation. It means the solid is desribed using boundaries (typically lines) and data, describing relationships.
karthik m said:but i need complex shape / shape element. (like output of drop Element: solids To Surfaces).
Did you try to use Drop method? I do not recall other method that can be used, because internal structure of SmartSolid is not available in VBA. Probably to call some native C function is the only way.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point