Hi all,
Is there an easy way to convert dgn tag data to xfm feature properties asccosiated with a cell/sharded cell element and then doing an
export to a shp file. The tag data should get the attributes!
examaple dgn below
Frank,
Using VBA along with the Bentley Map XFT (XFM Feature Toolkit) library, you can convert tag data into XFM business properties. A pattern similar to the following could be applied.
Function GetTagSet(strName As String) As TagSet Dim oTagSets As TagSets Set oTagSets = ActiveDesignFile.TagSets On Error Resume Next Set GetTagSet = oTagSets(strName) If GetTagSet Is Nothing Then Set GetTagSet = oTagSets.Add(strName) End Function Private Sub ILocateOpEvents_OnFinished(ByVal locateOp As xft.ILocateOp) Dim te As TagElement Dim oTagSet As TagSet Dim strTagSetName As String Dim strPropertyValue As String Dim oRegionElement As element Dim oFeature As feature Dim fe As FeatureEnumerator Set fe = locateOp.GetLocatedFeatures strTagSetName = "Counties" Set oTagSet = GetTagSet(strTagSetName) Do While fe.MoveNext Set oFeature = fe.Current Set oRegionElement = oFeature.GetRelatedRegionElement With oFeature If oRegionElement.HasAnyTags Then Set te = oRegionElement.GetTag(oTagSet, "CountyName") strPropertyValue = te.Value Else strPropertyValue = "Unknown" End If .SetProperty "CountyName", strPropertyValue .ApplyAttributeChanges .Write (False) End With Loop End Sub
End Sub
Regards,
Jeff Bielefeld [Bentley]
perfect Jeff, Thank you very much!
Regards
Frank
since 1985: GIS, CAD, Engineering (Civil) Senior Consultant : [Autodesk Civil 3D , Esri ArcGIS, VertiGIS: in previous days : Bentley MS V4 - V8i, GeoGraphics, Bentley Map V8i, InRoads, HHK Geograf, IBr DAVID] : Dev: [C, C++, .NET, Java, SQL, FORTRAN, UML][direct quote by: http://en.wikipedia.org/wiki/Helmut_Schmidt]: "Wer Kritik übel nimmt, hat etwas zu verbergen"Wer Grammatik- und/oder Rechtschreibfehler findet, der darf sie behalten :-)
Hello.
Is there a way to reverse this situation?
My idea to to create tags based on xfm properties and attach to the element?
Hi Dawid,
Unknown said:Is there a way to reverse this situation?
I assume the solution is similar to the one provided by Jeff - small VBA application.
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point