WhoCanDo Posted October 25, 2018 Share Posted October 25, 2018 Hi, Can anyone tell me how I can get this to work please? If T=Wall it works, but not if T=RoundWall. This is because the center point of the RoundWall is not within LOC. Procedure Check_for_Wall (hKP : handle); begin AlertDialog ('Here'); end; Procedure Check_Adjust (h : handle); begin SetName (h, 'Tmp'); ForEachObject (Check_for_Wall, ((Loc = 'Tmp') & ((T = Wall) or (T = RoundWall)))); DelName ('Tmp'); end; Begin Get the handle from bounding polygon and pass to Check_Adjust end; Quote Link to comment
JBenghiat Posted October 25, 2018 Share Posted October 25, 2018 You may have to make your script a little more complex: http://developer.vectorworks.net/index.php/VS:ForEachObjectAtPoint Quote Link to comment
Pat Stanford Posted October 25, 2018 Share Posted October 25, 2018 I believe that Loc only returns objects that have the center point of the object bounding box within the named object. For Round Walls it appears that it is the center point. I just did a test and can get a round wall to be counted as part of a space even when the wall itself is outside as long as the center point is in the names object. For regular walls the critical point appears to be the center point of the wall. So to answer your question, yes, it is because the center point is outside of the object. Quote Link to comment
WhoCanDo Posted October 25, 2018 Author Share Posted October 25, 2018 (edited) Thanks JB, I will give that a go 😊 Edited October 25, 2018 by WhoCanDo Misread Quote Link to comment
WhoCanDo Posted October 26, 2018 Author Share Posted October 26, 2018 Finally. Fixed. Couldn't use ForEachObjectAt because a point is not and object for LOC, so I ended up finding all RoundWalls, calculating the center (of the wall not the CL), adding another 2mm straight wall at that location, so that LOC worked. Unfortunately, SetName did not work because LNewObj & LActLayer failed as usual, so I ended up finding all 2mm walls at the end and deleting them. A lot of fussing around when LOC says "Location is contained within boundary of a named object". Thanks all. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.