MTRobin Posted March 10, 2021 Share Posted March 10, 2021 (edited) Hi Everyone, Can someone please give me an example on how to create a script to insert a symbol at a specific location and place it on a specified layer? I am trying to automate common symbols I place on drawings and having them auto allocate to their layers. In this example I am trying to place a table symbol at 0'-0", 0'-0", 0'-0" on the "Staging" layer and a lighting console symbol inserted as a lighting device at 0'-0", -8'6 1/2", 3'7 3/8" on the "Lighting" layer. Any help would be appreciated. Thank you, Maxwell Edited March 10, 2021 by MTRobin Quote Link to comment
Pat Stanford Posted March 11, 2021 Share Posted March 11, 2021 Layer('Staging)' Symbol('Table', 0, 0, 0); Where the third zero is the rotation. Layer('Lighting'); Symbol('Console', 0, 8' 6.5", 0); Move3DObj(LNewObj, 0, 0, 3'7.375"); I don't know how to make it a lighting device. Since there are no variables you should be OK to run the above as is. If you expand to need variables then you need all of the procedure statements and Begin/End functionality. Ask again for more help. Quote Link to comment
MTRobin Posted March 11, 2021 Author Share Posted March 11, 2021 Thank you for your help. This should get me started. Quote Link to comment
Ross McLee Posted March 11, 2021 Share Posted March 11, 2021 @MTRobin - sounds like you are on a similar journey to me - good luck! @Pat StanfordWhen it comes to inserting 'things' and manipulating them - how does the script know where to get the thing (in this case a symbol) from? Does it need to already be a resource within the file, or will VW search for the symbol in the resource library, which then begs the question what if it doesn't exist, or if there are duplicates (but I will skip that for now). R Quote Link to comment
Pat Stanford Posted March 11, 2021 Share Posted March 11, 2021 If you want to insert a symbol, it either has to be in the existing file or you have to go to an entirely different level of complexity to find the resource in a different file and import it into the existing file prior to inserting. You might be able to insert a referenced symbol, but I think that would be an even higher level of complexity. 1 Quote Link to comment
Peter Vandewalle Posted March 12, 2021 Share Posted March 12, 2021 The only solutio I'd see is to add a record to all the involved symbols and have a specific field indicate the desired layer upon insertion. So after inserting the symbol a script could read the record field value an move the object (symbol) to the correct layer. It could even create the layer if that one doesn't exist yet. 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.