Hi,I'm trying to understand XFM in VBA but I have a little problem. I would like to change the property of a Feature and I do not know how. If I do so:
Sub XLS2XFM()Dim ee As ElementEnumeratorDim esc As New ElementScanCriteriaDim att As AttachmentDim oFeature As xft.featureDim RootFeature As xft.IFeatureDim oLocateOp As New locateOpDim tempDane As String
Set ee = ActiveModelReference.Scan()Do While ee.MoveNext if ee.curent.isgraphical then
Set oFeature = xft.FeatureMgr.CreateFeature(ee.Current) tempDane = oFeature.GetProperty("No1")
oFeature.SetProperty "No1", arrExcel(i, 1) End IfLoopEnd Sub
I created a new Feature. How to change a property of the existing element / Feature.
regardsadrian
did you rewrite the feature back to the file ?
No, I did't.
should I use ILocateOpEvents
something like this:
communities.bentley.com/.../173714.aspx
Here is a way to do this.
Use a ILocateOpEvents.
Then try something like this.
CmdMgr.StartLocateOperation oLocateOp, featureScan
Do While featureScan.fe.MoveNext
Dim f As xft.feature
Dim property As String
Dim ftrDef As xft.FeatureDef
Dim propdef As xft.PropertyDef
Dim propcnt As Integer
Dim j As Long
Set f = featureScan.fe.Current
property = f.GetProperty("ROOM_NUM")
If Len(property) > 0 Then
f.SetProperty "SPACEDESCRIPTION", space.SpaceDescription
f.SetProperty "BUILDINGPOWERDENSITY", space.BuildingPowerDensity
f.SetProperty "BUILDINGTYPE", space.BuildingType
f.SetProperty "FIXTURENO", space.FixtureNo
f.SetProperty "LIGHTINGLOAD", space.LightingLoad
f.SetProperty "LIGHTINGPOWERDENSITY", space.LightingPowerDensity
f.SetProperty "SHAPE_Area", space.SpaceArea
f.SetProperty "SPACEILLUMINATIONAVERAGE", space.SpaceIlluminationAverage
f.SetProperty "SPACEMAXLIGHTPOWERDENSITY", space.SpaceMaxLightPowerDensity
f.SetProperty "SPACETYPE", space.SpaceType
' Write it back to the file.
f.Write False
End If
Loop
ok, thanks