I'm testing Extrude to solid method as follows:
Sub TestExtrude() Dim oEle As Element 'Dim oSmartSolid As SmartSolid Dim oSmartSolidEle As SmartSolidElement Set oEle = ActiveModelReference.GetElementByID(DLongFromString("62494")) 'This is not necessary as Jan pointed out below 'Set oSmartSolid = SmartSolid If oEle.IsPlanarElement Then ' Set oSmartSolidEle = oSmartSolid.ExtrudeClosedPlanarCurve(oEle, 100, 0, True) Set oSmartSolidEle = SmartSolid.ExtrudeClosedPlanarCurve(oEle, 100, 0, True) End If ActiveModelReference.AddElement oSmartSolidEle oSmartSolidEle.Redraw End Sub
The problems are
1. what I got is different from what I manually extruded by using command "Solid by Extrusion". See pic below, the left one is what I extruded manually, the right one is by code. the manual one is solid, the code one is smartsolid; the manual one is just one element, the code one is two elements, the original profile and the extruded smartsolid;
2. The method syntax is
Syntax
Set SmartSolidElement = object.ExtrudeClosedPlanarCurve (planarClosedElement, forwardDist, backwardDist [, capSurface])
But even I changed the forwardDis or/backwardDis, but there is no difference with extrusion direction, in this case, always downward.
Questions:
1. How can I make the code one as the same as the manual one?
2. How to control the extrude direction?
Any replies appreciated. Thanks.
Unknown said:I would never have thought about that setting will affect the extrusion later..thanks again.
I also not ... learning every day :-)
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Unknown said: You should start your macro with ? 1 SetCExpressionValue "tcb->smartGeomSettings.flags.representAsSurfaces", 1, "3DTOOLS" to be sure the setting has the correct value (surface). Regards, Jan
You should start your macro with
SetCExpressionValue
"tcb->smartGeomSettings.flags.representAsSurfaces"
, 1,
"3DTOOLS"
to be sure the setting has the correct value (surface).
Regards,
Thank you soooo much Jan, you're amazing! I would never have thought about that setting will affect the extrusion later..thanks again.
Answer Verified By: Wence
SetCExpressionValue "tcb->smartGeomSettings.flags.representAsSurfaces", 1, "3DTOOLS"
Seed3dm.dgn
both smartsolid and solid in your file look the same. So I attached my file, but no matter which display style I used, smooth or illustration, my smartsolid by vba still looks not good, very strange...
How this file is displayed? And what display style do you use?
work3d.dgn
Thanks again Jan. My SS3 is 08.11.09.536.
I tested again, extrude a circle, but same result.