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."
![image](https://private-user-images.githubusercontent.com/101549988/343122329-a027aff1-681d-4483-988f-e9d9c63a081d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxNTcwMTEsIm5iZiI6MTcyNjE1NjcxMSwicGF0aCI6Ii8xMDE1NDk5ODgvMzQzMTIyMzI5LWEwMjdhZmYxLTY4MWQtNDQ4My05ODhmLWU5ZDljNjNhMDgxZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSE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zUzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Pvr_dbBl0YVdg9kNa3WFAm8zI9duXRMeAx7FuM9gxtQ)
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