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:What I got is different from what I manually extruded by using command "Solid by Extrusion"
The MicroStation command produces a primitive type 18/19 surface/solid. I suppose that the command is maintained for legacy reasons. A primitive solid is suitable for purpose.
With VBA, you have no option to use or create a type 18/19 surface/solid. The only solid is a SmartSolid, which is why your code creates one.
Regards, Jon Summers LA Solutions