The issue is that I the contours I have came from a .shp file and the line elevations are not being stored as elevations. Instead they are being stored as string values in a property called "ELEVATION". I have tried many different ways to get these come in with elevation so I can create a surface, but so far with no luck. I was thinking that I could write a macro to get each line in my selection and pull the value from the property and set it as the line elevation.
What I have so far:
Public Sub ImportElevations()Dim oElEnum As ElementEnumeratorDim oEl As LineElementDim oPropHand As PropertyHandlerDim getElevationFromCustom As String
Set oElEnum = ActiveModelReference.GetSelectedElementsoElEnum.ResetWhile oElEnum.MoveNext Set oEl = oElEnum.Current Set oPropHand = CreatePropertyHandler(oElEnum.Current) If (oPropHand.SelectByAccessString("ELEVATION")) Then getElevationFromCustom = oPropHand.GetDisplayString ' Write getElevationFromCustom to line elevation End IfWend oEl.Redraw msdDrawingModeNormal oEl.RewriteEnd Sub
Has anyone dealt with this before?
Thanks,
Matt
Matt,
The ELEVATION element properties value you provided within the sample .dgn file can be get and set the property without any problems. Presuming that you are not encountering any problem in doing so, to set an element's elevation (z depth points) you may want to refer to the MicroStation VBA Help file topic: "Flattening Elements" that provides some sample code to "flatten" an element to the current view depth setting.
If Jan's suggestion does not help with your specific workflow/goal's end results maybe you could provide some additional details describing what your overall workflow would be. And let us know if the goal is to modify elements elevation directly in the .shp file/project or creating elements at a desired elevation stored in a seperate output .dgn file having no further requirements to synchronize with the original .shp file/project elements.
Bob