I resume this old discussion of 2016 and I ask .... in the event that we find a complex form (MSDelementtyPecomplexshape) how the function should be changed to be able to elevate a shape that contains two arches and two lines.
Option Explicit Sub TestMoveShape() Dim elemId As DLong elemId = DLongFromLong(1307192) Dim el As Element Set el = ActiveModelReference.GetElementByID(elemId) If (msdElementTypeShape = el.Type) Then processShape el.AsShapeElement End If End Sub Private Sub processShape(shape As ShapeElement) Dim numOfVertices As Long numOfVertices = shape.VerticesCount Dim index As Long For index = 1 To numOfVertices shape.vertex(index) = moveVertex(shape.vertex(index)) Next shape.Rewrite End Sub Private Function moveVertex(vertex As Point3d) As Point3d Const zVal = 53.65 moveVertex = vertex moveVertex.Z = zVal End Function
Tiziano Sapora said:how the function should be changed to be able to elevate a shape that contains two arches and two lines.
It’s not clear what you are trying to accomplish, can you share screenshots showing the before and after?
I simply would like to adapt the previously attached code to make sure that given a complex shape consisting of two lines and two arches that enclose a text, it can be made so that everything can be translated compared to the Z to a value specified by the user. The attached code already does it but with a "msdelemendypeshape" type form Thank you.
correct "AsShapeElement"
Tiziano Sapora said:I simply would like to adapt the previously attached code to make sure that given a complex shape consisting of two lines and two arches that enclose a text, it can be made so that everything can be translated compared to the Z to a value
Move away from individual DGN elements and look at a bigger picture.
All graphic elements have a Transform method. That method takes a Transform3d matrix. Construct a Transform3d using the many methods available. See MicroStation VBA help for examples.
Transform
Transform3d
Regards, Jon Summers LA Solutions