I am using vba inside of MicroStation CONNECT Edition and successfully created a simple rectangular slab. Now when I'm trying to get all the vertices, but IsVertexList is always False. Any help would be greatly appreciated.
Dim mySSE As SmartSolidElement ' create a slab with center at 0,0,0 Set mySSE = SmartSolid.CreateSlab(Nothing, 6, 12, 2) ActiveModelReference.AddElement mySSE2 mySSE.Redraw
' this part below is where I try to get the vertices
Dim vertices() As Point3d
If mySSE.IsVertexList Then vertices = mySSE.GetVertices() End If
Hi,
StruX said:but IsVertexList is always False
It means the object (SmartSolidElement) does not support (implement) this interface. It's the same result as in V8i.
StruX said:Any help would be greatly appreciated.
GetVertices method works in MicroStation V8i fine (even when IsVertexList returns false), but it does nothing in CE U14. So I guess you should create Service Ticket and to report it as bug.
Artur Goldsweer, would you be so kind and to test it?
StruX said:mySSE.Redraw
This line of code is useless for about 15 years (from V8 XM Edition). MicroStation takes care about element redraw when they are added, deleted or modified.
StruX said:and successfully created a simple rectangular slab
I do not know what is your aim (what functionality you want to implement using VBA), but be aware VBA is very limited when working with 3D elements. It allows to access SmartSolid and SmartSurface elements (which are treated as obsolete in CE), but not to work with new parametric solids.
With regards,
Jan
P.S. Please follow the forum best practices and use Insert > Insert code tool every time a code snippet (even one line only) is posted. To read code formatted as normal text is just annoying.
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan Šlegr said:Artur Goldsweer, would you be so kind and to test it?
Hi Jan,
sorry for answering late, I have tested this and can confirm in V8i the method .GetVertices() is working for this slab, although .IsVertexList is false.It seems this was fixed with CONNECT Edition. I have also tested to use the method Drop() with this SmartSolid and it provides an enumerator containing all the lines describing the slab.The start- and endpoints of these lines could be used to build the list with vertices.
Best regards,
Artur
Hi Artur,
Artur Goldsweer said:I have tested this and can confirm in V8i
thanks for your reaction :-)
Artur Goldsweer said:It seems this was fixed with CONNECT Edition.
Frankly, I am not sure whether it's what I treat as "fix", because the method worked fine providing correct results in V8i and after "the fix", it cannot be used now.
I would prefer the vertices are returned always, even for solids without vertices (empty list).
Artur Goldsweer said:The start- and endpoints of these lines could be used to build the list with vertices.
Yes, but it makes the code more complicated.
But it's true that VBA is not recommended API for any 3D objects code ;-)