SamIWas Posted September 20, 2020 Share Posted September 20, 2020 (edited) With the lighting device, I can just use SetRField and GetRField to get and set info for the lighting device. With door, this doesn't seem to work. As a test, I used GetRField(h,'Door','2DLeafClass') and GetRField(h,'Door','2D Leaf Class'). but neither works. Is there different way to get and set door info via script? EDIT: I have found that it works when the door is not in a wall. But, once the door is placed in a wall, I can no longer get the script to pull info from it. Surely there is a way. Edited September 20, 2020 by SamIWas Quote Link to comment
MullinRJ Posted September 20, 2020 Share Posted September 20, 2020 Are you sure you have a handle to the Door and not the Wall? Raymond Quote Link to comment
SamIWas Posted September 20, 2020 Author Share Posted September 20, 2020 Just now, MullinRJ said: Are you sure you have a handle to the Door and not the Wall? Raymond The test script is set to give me an alert box with the handle. If I put the door alone in the drawing, it returns a series of numbers. When I put the door in the wall, and select only the door, I get a blank. Quote Link to comment
MullinRJ Posted September 20, 2020 Share Posted September 20, 2020 Using: Message(GetTypeN(FSActLayer)); If I select a free standing Door I get type 86 (Plug-In object). If I select a a Door in a Wall I get type 68 (Wall object). To see the Door on a test wall I have in an open document, I needed to use: Message(GetTypeN(NextObj(NextObj(NextObj(NextObj(NextObj(NextObj(NextObj(FIn3D(FSActLayer)))))))))); As you can see, the door object is deep inside the Wall object. The number of objects in front of it are not exact, and are determined by the wall's construction. You should use a loop to look for the Door, or possibly try ForEachObjectAtPoint(). There may be a more direct way to get to the Door-in-Wall that someone else can point to. I've just done a cursory quick dive at this. Again, make sure your handle is pointing to a Door object before trying to access its record. HTH, Raymond Quote Link to comment
SamIWas Posted September 21, 2020 Author Share Posted September 21, 2020 3 hours ago, MullinRJ said: Using: Message(GetTypeN(FSActLayer)); If I select a free standing Door I get type 86 (Plug-In object). If I select a a Door in a Wall I get type 68 (Wall object). To see the Door on a test wall I have in an open document, I needed to use: Message(GetTypeN(NextObj(NextObj(NextObj(NextObj(NextObj(NextObj(NextObj(FIn3D(FSActLayer)))))))))); As you can see, the door object is deep inside the Wall object. The number of objects in front of it are not exact, and are determined by the wall's construction. You should use a loop to look for the Door, or possibly try ForEachObjectAtPoint(). There may be a more direct way to get to the Door-in-Wall that someone else can point to. I've just done a cursory quick dive at this. Again, make sure your handle is pointing to a Door object before trying to access its record. HTH, Raymond Holy schniekies. So, it looks like selecting a bunch of doors throughout a document and trying to change records in this way wouldn't work very well. What I was trying to do was create a script that would assign my default class scheme to doors that I pull in from older drawings. Quote Link to comment
Pat Stanford Posted September 21, 2020 Share Posted September 21, 2020 It actually is not that bad. There are a number of ways to do it with some fairly simple loops. Probably the easiest would be a ForEachObject using a Criteria of Selected is True and PON = 'Door'. PON stands for Plug-in Object Name. Code fragment not tested: Procedure(Test); Procedure Execute(Hd1:Handle); Begin SetClass(Hd1,'MyClass'); End; Begin ForEachObject(Execute, (((Sel=True) & (PON='Door')))); End Run(Test) Quote Link to comment
MullinRJ Posted September 21, 2020 Share Posted September 21, 2020 I knew someone (@Pat Stanford) would have an elegant way to get inside. Thanks, Pat. Raymond Quote Link to comment
SamIWas Posted September 21, 2020 Author Share Posted September 21, 2020 37 minutes ago, Pat Stanford said: It actually is not that bad. There are a number of ways to do it with some fairly simple loops. Probably the easiest would be a ForEachObject using a Criteria of Selected is True and PON = 'Door'. PON stands for Plug-in Object Name. Code fragment not tested: Procedure(Test); Procedure Execute(Hd1:Handle); Begin SetClass(Hd1,'MyClass'); End; Begin ForEachObject(Execute, (((Sel=True) & (PON='Door')))); End Run(Test) Thanks Pat! I'll try this tomorrow and see how it goes. Quote Link to comment
SamIWas Posted September 21, 2020 Author Share Posted September 21, 2020 16 hours ago, Pat Stanford said: It actually is not that bad. There are a number of ways to do it with some fairly simple loops. Probably the easiest would be a ForEachObject using a Criteria of Selected is True and PON = 'Door'. PON stands for Plug-in Object Name. Code fragment not tested: Procedure(Test); Procedure Execute(Hd1:Handle); Begin SetClass(Hd1,'MyClass'); End; Begin ForEachObject(Execute, (((Sel=True) & (PON='Door')))); End Run(Test) Holy crap, man...that worked! This is going to make updating old files, and inserting new doors and windows, so much faster! 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.