I have got a problem that at least did not exist in BentleyMap SS2. I have veryfied that it exist in Bentley Map SS3 built 95 and sadly enough also in the new service release with built no 107.
In short:
I have a small Mvba app that defines a new featureclass OisPunkt with a number of properties. Then I create a number of these features and I can check that they are created with the properties. BUT when I start the databrowser it will not accept the feature Class defintion and show only the feature instance without properties.
Documentation:
FeatureClasse definition
:
Mvba code creating and verifying the feature class definitions:
CreateFeatureClass and AddPropertyToFeatureClasse are both functions in a MDL DLL
Public Sub StartOisClient(ByVal feltliste As String)Set OISclient = CreateObject("OISlib.OISclient")If OISclient.SetLogon(OISUSER, OISPWD) = False Then'ved at spørge på paramtren sættes denEnd IfIf modX34featdef.TjekFeatDef("OisPunkt") = False Then CreateFeatureClass StrPtr("OisPunkt"), XFMFEATUREGISTYPE_PointLineEnd IfIf modX34featdef.TjekFeatAttribDef("OisPunkt", "MATR_NR") = False Then AddPropertyToFeatureClass StrPtr("OisPunkt"), StrPtr("MATR_NR"), XFM_DATATYPE_STRING, 10 AddPropertyToFeatureClass StrPtr("OisPunkt"), StrPtr("EJERLAV"), XFM_DATATYPE_STRING, 80End IfDim Felt As VariantDim strFelt As StringFor Each Felt In Split(felt_liste, ",") strFelt = Felt If modX34featdef.TjekFeatAttribDef("OisPunkt", strFelt) = False Then AddPropertyToFeatureClass StrPtr("OisPunkt"), StrPtr(strFelt), XFM_DATATYPE_STRING, 80 End IfNextmodX34featdef.DumpFeatureDefinitionProperties "OisPunkt"End Sub
Here comes the code for DumpFeatureDefinitionProperties:
Public Sub DumpFeatureDefinitionProperties(FeatureName As String) Debug.Print "--------" Dim message As String Dim oFeatureDef As FeatureDef On Error GoTo *** Set oFeatureDef = xft.FeatureMgr.GetFeatureDefinition(FeatureName) Dim strGeomType As String Select Case oFeatureDef.GeometryType Case 0: strGeomType = "UNKNOWN" Case 1: strGeomType = "LINE STRING or CURVE" Case 2: strGeomType = "POLYGON" Case 3: strGeomType = "POINT" Case 4: strGeomType = "TEXT" End Select message = "FeatureClass: " & oFeatureDef.Name & ", " & strGeomType dmsgPrint StrPtr(message) Dim numProperties As Long numProperties = oFeatureDef.PropertyCount Dim propertyIndex As Long For propertyIndex = 0 To (numProperties - 1) Dim oPropertyDef As PropertyDef Set oPropertyDef = oFeatureDef.GetPropertyDefinition(propertyIndex) message = " " & oPropertyDef.Name & ", " & oPropertyDef.TypeName dmsgPrint StrPtr(message) 'Debug.Print oPropertyDef.Name, oPropertyDef.TypeName Next***:End Sub
Here comes a Analyze Feature of one of the newly created features:
And last the Databrowser:
What has happen since version SS2 since the Databrowser (and the Edit feature function as well) no longer uses the feature Class definition cache
If I close Bentley map and open with the same designfile the Dynamic Feature Scoring findes the properties (offcause)
Erik Wirring
LE34
I do not see xfmcore.lib in that output. You will need to also link with this library.
Regards,
Chris
Hi Erik,
Regarding the DFS created feature definition, you might consider setting up a design application to load after Map/XFM(Map MS_DGNAPPS loads XFM) so you can set the DFS generated feature definition to stay in the session. xfmFeatureDef_create will tell you if the definition currently exists in the session.
Thanks!
That helped -I had not noticed that you wrote that it was in the xfmcore.lib, but now you point it out. I can see my error :-)
Now my On-The-Fly featuredefinitions stays put if all instance of the feature is deleted.
Hi Chris
I did some more testing and the result is rather surprising, and it indicates that your suggestion propably will not work .-(
I took my test file, removed all instance of OisPunkt but left the layser "Oispunkt" empty. Then closed the BMap session, and restarted BMap with my test file.
just after startop I used the "Mdl command dumpfeaturedefbyname OisPunkt". Here I could see that DFS had not created any featuredefinition on the existens of the layer "OisPunkt". Then I ran by application which create the feature definition and a number of instances of the feature OisPunkt. Tested that the featuredefinition was okay. and last loaded DataBrowser which refused to show the properties.
Next test I just placed a simple line on the layer "OisPunkt" so it was not completly empty. Closed and reopened BMap.
First test with "Mdl command dumpfeaturedefbyname OisPunkt" shows that DFS now has created a featuredefinition:
command dumpfeaturedefbyname: FeatureDef (0x16247a8) Name [OisPunkt] Path [] Key=266 RefCnt=4command dumpfeaturedefbyname: Description [(null)] CategoryName [] GISTypeName [linestring/curve]command dumpfeaturedefbyname: IsCollection=FALSEcommand dumpfeaturedefbyname: NumSubFeatures=0command dumpfeaturedefbyname: NumProperties=1 NumDgnProperties=0command dumpfeaturedefbyname: Owner: ApplicationId=22564, ApplicationType=14command dumpfeaturedefbyname: PropertyDef (0x2092ef38) Name[Geometry_Length] DisplayName[Geometry_Length] FullName[Geometry_Length] TypeName[DOUBLE] TypeId=4 MaxSize=0 External=Y ReadOnly=Y RefCnt=4command dumpfeaturedefbyname: QueryNodeList size=0command dumpfeaturedefbyname: InsertNodeList size=0command dumpfeaturedefbyname: CopyNodeList size=0command dumpfeaturedefbyname: UpdateNodeList size=0command dumpfeaturedefbyname: DeleteNodeList size=0command dumpfeaturedefbyname: DBLinkNodeList size=0command dumpfeaturedefbyname: QueryCList size=0command dumpfeaturedefbyname: InsertCList size=0command dumpfeaturedefbyname: CopyCList size=0command dumpfeaturedefbyname: UpdateCList size=0command dumpfeaturedefbyname: DeleteCList size=0command dumpfeaturedefbyname: DBLinkCList size=0
Then I started my application which now updates the featuredefinition instead of creating a new featuredefinition along with creating the
instances of the feature "OisPunkt". Now the featuredefition looks like this (which is exactly the same as in the first test!):
command dumpfeaturedefbyname: FeatureDef (0x16247a8) Name [OisPunkt] Path [] Key=266 RefCnt=10command dumpfeaturedefbyname: Description [(null)] CategoryName [] GISTypeName [linestring/curve]command dumpfeaturedefbyname: IsCollection=FALSEcommand dumpfeaturedefbyname: NumSubFeatures=0command dumpfeaturedefbyname: NumProperties=7 NumDgnProperties=6command dumpfeaturedefbyname: Owner: ApplicationId=22564, ApplicationType=14command dumpfeaturedefbyname: PropertyDef (0x2092ef38) Name[Geometry_Length] DisplayName[Geometry_Length] FullName[Geometry_Length] TypeName[DOUBLE] TypeId=4 MaxSize=0 External=Y ReadOnly=Y RefCnt=4command dumpfeaturedefbyname: PropertyDef (0x198b0e78) Name[MATR_NR] DisplayName[MATR_NR] FullName[MATR_NR] TypeName[STRING] TypeId=1 MaxSize=10 External=N ReadOnly=N RefCnt=2command dumpfeaturedefbyname: PropertyDef (0x20bb9a90) Name[EJERLAV] DisplayName[EJERLAV] FullName[EJERLAV] TypeName[STRING] TypeId=1 MaxSize=80 External=N ReadOnly=N RefCnt=2command dumpfeaturedefbyname: PropertyDef (0x20bb9b98) Name[EJER_NAVN] DisplayName[EJER_NAVN] FullName[EJER_NAVN] TypeName[STRING] TypeId=1 MaxSize=80 External=N ReadOnly=N RefCnt=2command dumpfeaturedefbyname: PropertyDef (0x20bb9ca0) Name[EJER_ADR] DisplayName[EJER_ADR] FullName[EJER_ADR] TypeName[STRING] TypeId=1 MaxSize=80External=N ReadOnly=N RefCnt=2command dumpfeaturedefbyname: PropertyDef (0x20bb9da8) Name[EJER_UDV_ADR] DisplayName[EJER_UDV_ADR] FullName[EJER_UDV_ADR] TypeName[STRING] TypeId=1 MaxSize=80 External=N ReadOnly=N RefCnt=2command dumpfeaturedefbyname: PropertyDef (0x20bb9eb0) Name[EJER_POSTADR] DisplayName[EJER_POSTADR] FullName[EJER_POSTADR] TypeName[STRING] TypeId=1 MaxSize=80 External=N ReadOnly=N RefCnt=2command dumpfeaturedefbyname: QueryNodeList size=0command dumpfeaturedefbyname: InsertNodeList size=0command dumpfeaturedefbyname: CopyNodeList size=0command dumpfeaturedefbyname: UpdateNodeList size=0command dumpfeaturedefbyname: DeleteNodeList size=0command dumpfeaturedefbyname: DBLinkNodeList size=0command dumpfeaturedefbyname: QueryCList size=0command dumpfeaturedefbyname: InsertCList size=0command dumpfeaturedefbyname: CopyCList size=0command dumpfeaturedefbyname: UpdateCList size=0command dumpfeaturedefbyname: DeleteCList size=0command dumpfeaturedefbyname: DBLinkCList size=0
And NOW dataBrowser shows all the properties as it should.!
So is it possible to conclude any thing from this ?
I am not able to reproduce results like you mention here:
"I took my test file, removed all instance of OisPunkt but left the layser "Oispunkt" empty. Then closed the BMap session, and restarted BMap with my test file.just after startop I used the "Mdl command dumpfeaturedefbyname OisPunkt". Here I could see that DFS had not created any featuredefinition on the existens of the layer "OisPunkt". Then I ran by application which create the feature definition and a number of instances of the feature OisPunkt. Tested that the featuredefinition was okay. and last loaded DataBrowser which refused to show the properties."
"I took my test file, removed all instance of OisPunkt but left the layser "Oispunkt" empty. Then closed the BMap session, and restarted BMap with my test file.
just after startop I used the "Mdl command dumpfeaturedefbyname OisPunkt". Here I could see that DFS had not created any featuredefinition on the existens of the layer "OisPunkt". Then I ran by application which create the feature definition and a number of instances of the feature OisPunkt. Tested that the featuredefinition was okay. and last loaded DataBrowser which refused to show the properties."
I am using Map Enterprise 8.11.9.107 in the msgeo user using the gasmain mdl example. My observations match until your last sentence above. In my case, I do see my feature properties as expected. This is strange. I cannot figure out what is different between my scenario and yours.
What Map product and version are you using? Can you send your dgn with a few of your instances so that I can try your scenario starting from the step to delete the instances in the file? Can you send the code snippet that creates the feature definition?