Changing Space.Location causes exception "Unable to find RoomElem handle"?

Changing Space.Location causes exception "Unable to find RoomElem handle"?

colin_magner
Advocate Advocate
488 Views
2 Replies
Message 1 of 3

Changing Space.Location causes exception "Unable to find RoomElem handle"?

colin_magner
Advocate
Advocate

I'm writing an app to help manage MEP spaces when architectural changes have occurred to rooms in a linked model.  

 

In a scenario where a room has moved to another part of the project, I've determined the location point of the room (translated to the coordinate system of the MEP model), and want to change the location property of an MEP space to match that of the room.

 

The only way I can see to do this is to retrieve the Location of the space as a LocationPoint, and then set this to the desired XYZ point, as below.  In the following code, space is an MEP Space, newLocationPoint is an XYZ object.

 

LocationPoint spaceLocation = space.Location as LocationPoint;
spaceLocation.Point = newLocationPoint;

 

This does move the space to the correct location, but it also throws an exception with the message "Unable to find RoomElem handle".  I don't understand what this exception means, can anyone clarify?  Can I simply catch the exception and carry on or am I doing something wrong that I need to address?

 

Thanks.

0 Likes
489 Views
2 Replies
Replies (2)
Message 2 of 3

JimJia
Alumni
Alumni

Dear Colin Magner, We checked the document you provided, unfortunately however it is hard to us to find a clue how to recreate this problem. In order to diagnose, could you isolate your test project and send us a small, reproducible sample? Note, please do not send us any information you think are confidential to your company. We appreciate your understanding and your patience again!


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
0 Likes
Message 3 of 3

colin_magner
Advocate
Advocate

Jim,

 

Thanks for the response.  With workload etc. it will be a few weeks before I can return to this addin, so I'll provide a test project and addin then.

0 Likes