You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm expecting EntityContainer.Element(ObjectId) and EntityContainer.ElementOrDefault(ObjectId) to return only Entities that are children of the container.
Current Behavior
Currently it is possible to get an Entity that is present on a PaperSpace layout via the ModelSpace (see sample code below).
Context
Linq2Acad Version: 1.0.0
AutoCAD Version: 2022
Failure Information
The failure does not produce an error in the AutoCAD API. It is just a wrong behavior of Linq2Acad.
Sample Code
using(vardb=AcadDatabase.Active()){// We expect to have an Entity in the paper spacevarpaperSpaceEntity=db.PaperSpace.First().First();var_=db.ModelSpace.Element(paperSpaceEntity.ObjectId);System.Diagnostics.Debug.Fail("No exception thrown");// The above call should actually throw an exception because paperSpaceEntity is not present in the model spacevarresult=db.ModelSpace.ElementOrDefault(paperSpaceEntity.ObjectId);System.Diagnostics.Debug.Assert(result==null);// result should actually be null because paperSpaceEntity is not present in the model space}
Checklist
I am running the latest version
I checked the documentation and found no answer
I checked to make sure that this issue has not already been filed
I have provided sufficient information for the team
The text was updated successfully, but these errors were encountered:
Expected Behavior
I'm expecting
EntityContainer.Element(ObjectId)
andEntityContainer.ElementOrDefault(ObjectId)
to return onlyEntities
that are children of the container.Current Behavior
Currently it is possible to get an
Entity
that is present on aPaperSpace
layout via theModelSpace
(see sample code below).Context
Failure Information
The failure does not produce an error in the AutoCAD API. It is just a wrong behavior of Linq2Acad.
Sample Code
Checklist
The text was updated successfully, but these errors were encountered: