Replies: 1 comment 1 reply
-
The PhysicalElementFulfillsFunction relationship is defined in the Functional schema. Is this schema imported in your iModel? You can find out by seeing if the following query returns a schema with the name SELECT * FROM ECDbMeta.ECSchemaDef Schemas can be downloaded from npm, the functional schema package can be found here: https://www.npmjs.com/package/@bentley/functional-schema That said it is possible that this relationship will not work for you because it requires that there be a functional element, the .dwg is likely to just get you drawing graphics. Notice how in the sample the queries join Physical <-> Functional <-> Drawing to make the connection. const elementMapQuery = `
SELECT physToFunc.SourceECInstanceId as physElementId, drawToFunc.SourceECInstanceId as drawElementId, drawing.Model.Id as drawModelId
FROM Functional.PhysicalElementFulfillsFunction physToFunc
JOIN Functional.DrawingGraphicRepresentsFunctionalElement drawToFunc
ON physToFunc.TargetECInstanceId = drawToFunc.TargetECInstanceId
JOIN Bis.DrawingGraphic drawing
ON drawToFunc.SourceECInstanceId = drawing.ECInstanceId`; If you have functional elements or can create them, that is great and I suggest you add the extra fidelity to your iModel. If that is not possible, then you could directly connect your drawing and physical elements using the DrawingGraphicRepresentsElement relationship. I hope this helps. |
Beta Was this translation helpful? Give feedback.
-
"Hello, I'm trying to achieve a local implementation similar to the Cross-Probing example. I have imported a 3D view (.rvt) and a 2D drawing view (.dwg) into a .bim file using iTwin Snapshot. However, I encountered an error while establishing the relationship between the 2D and 3D views."
The error occurs at the point where the code is executed:
The error message:
"I'm not sure what's causing this issue. Could it be because of my merged model? If it's a model issue, how can I ensure I have the correct model? Any advice you have would be greatly appreciated."
Beta Was this translation helpful? Give feedback.
All reactions