We created a closed vertical shape element, and would like to convert it to solid by revolution with 360 degrees about Z axis. However, it is not successful in VBA. Great if you could provide an example.
What I have tried:
pointOnAxis = Point3dFromXYZ(0, 0, 0) 'Center point of Rotation axis = Vector3dFromXYZ(0, 0, 1) 'About Z axis angle = PI * 2 '360 degrees Set oSmartSloidElement = RevolveProfile (profile, pointOnAxis, axis, angle)
Answer Verified By: clever_anthony
this is not the case and still fails....why hasn't Bentley resolved this?
What version (e.g. v10.x.y.z) of MicroStation, or other product, are you using?
Paul Rowlands said:this is not the case and still fails
What is not the case? What still fails? Please show your code!
Regards, Jon Summers LA Solutions
Microstation: V8i 08.11.09.829
Sample Code:
Sub SimpleTest() Dim SimpleProfile As ComplexShapeElement Dim TestElement As ClosedElement Dim myProfileElement(3) As ChainableElement Set myProfileElement(0) = CreateLineElement2(Nothing, Point3dFromXYZ(0.0591, 0.0245, 0), Point3dFromXYZ(0.0836, 0.0806, 0)) Set myProfileElement(1) = CreateLineElement2(Nothing, Point3dFromXYZ(0.0836, 0.0806, 0), Point3dFromXYZ(0.0899, 0.0792, 0)) Set myProfileElement(2) = CreateLineElement2(Nothing, Point3dFromXYZ(0.0899, 0.0792, 0), Point3dFromXYZ(0.0899, 0.0203, 0)) Set myProfileElement(3) = CreateLineElement2(Nothing, Point3dFromXYZ(0.0899, 0.0203, 0), Point3dFromXYZ(0.0591, 0.0245, 0)) Set SimpleProfile = CreateComplexShapeElement1(myProfileElement()) ActiveModelReference.AddElement SimpleProfile Dim BodySolid As SmartSolidElement Dim StartPoint As Point3d Dim myVector As Vector3d Dim myAngle As Double Dim myElement As Element StartPoint = Point3dZero myVector = Vector3dFromXYZ(1, 0, 0) myAngle = Pi Set myElement = SimpleProfile Set BodySolid = SmartSolid.RevolveProfile(myElement, StartPoint, myVector, myAngle) ActiveModelReference.AddElement BodySolid End Sub
Error: @ Set BodySolid = SmartSolid.RevolveProfile(myElement, StartPoint, myVector, myAngle) (same as above reported over 2 years ago!)
I have also tested that the profile created by the code is compliant by revolving it manually....
and before you ask I don't have anything better to be doing on valentines!
Paul Rowlands said:Error: @ Set BodySolid = SmartSolid.RevolveProfile
Pi * 2
CapSurface()
Hi Paul,
Paul Rowlands said:why hasn't Bentley resolved this?
this discussion is about V8i and is over 2 years old. When MicroStation V8i (SELECTseries 4) was released in 2016, Bentley announced this product line is closed and will be not developed anymore and is replaced by CONNECT Edition.
So I think it's not surprise that something in V8i VBA, especially in 3D, is not fixed. But from the recent discussion I am not sure whether it's bug or just incorrectly used API.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Development and bug fixes are two different things. From what i've seen the majority of Microstation users are yet to migrate to CONNECT so surely, as a Benltey paying customer, such errors/bug should be supported.
a) revising the angle value produces same error (Pi * 2)
b) you can only invoke the capSurface after setting BodySolid = smartsolid, which is where the error occurs
c) It appears you can only revolve closed elements
I'm looking into the using the following:
Paul Rowlands said: It appears you can only revolve closed elements
From VBA help:
profile An Element expression. profile body which is swept along the path, it should not be a closed curve
profile
this is why my test profile consists of line elements for open and closed profiles. The description is not entirely accurate as for Rotation the profile is not swept along a path but revolved around a axis.
This works for me. Note that...
I've published the code in this article about SmartSolid.RevolveProfile.
Update....cause of the problem is global origins set at large values which a certain infrastructure client likes to use in their seed files.