alexrv Posted February 19, 2007 Share Posted February 19, 2007 Hi all, I think I understand how the "enable auto-classing" works. Is it by putting a plug-in object on the dwg and as soon as you drop it the object is put in a class that it was assigned to or it will create one if it is not existing already? Like the door symbol? If this is so, how can I get place plant tool to do the same? Like I want the trees on one default class and shrubs and gcs on its own default classes too. I dabbled a little on scripting,and I tried script editor to put in a default and it works but it puts all of them in one class. If someone knows also about scripting and how to solve this, chime in please. The reason for this is for easier selection and editing of the type of plants without having to select each one manually. Also I don't have to worry about plant symbols not being in the proper class. Now if there is another way to accomplish this then I'm all ears. Quote Link to comment
dspearman Posted February 19, 2007 Share Posted February 19, 2007 You can specify what class the tag is to go into in the plant definition. The script editor will allow you to set a class for new plant objects but you are correct, all plants must go into one class. In my case I use classes to categorize plants as new , existing, or remove so one class doesn't work - nor would any auto-class that is part of the plant definition or tools. The Plant Category (eg tree / shrub / etc) is stored in the plant record and you could use a script to select only plants of a specific category... Quote Link to comment
Petri Posted February 20, 2007 Share Posted February 20, 2007 (edited) Here's part of the reason why I wrote my own Plant Placement tool... Depending on what kind of plant one chooses, it'll be in the correct class. Why did I reveal it here - oh my! A certain Mr Robert Anderson, Vice President of NNA, has just told me that whatever good ideas I have and are brought into his attention, he'll copy into NNA's plug-ins. Well, imitation is the sincerest form of flattery... At least Mr Anderson copies from the best - good on him! Nevertheless, reclassifying objects post factum by record data is quite a trivial scripting exercise. PROCEDURE ClassifyByData; { ? Petri Sakkinen 2001 - 2007 } CONST rName='Data'; fName='Class'; VAR obHd : HANDLE; theClass : STRING; PROCEDURE DoIt (h : HANDLE); BEGIN theClass:=GETRFIELD(h, rName, fName); NAMECLASS(theClass); SETCLASS(h, theClass); END; BEGIN FOREACHOBJECT(DoIt, (R IN [rName])); END; RUN(ClassifyByData); Just change the constants to be the record name and field name in question. Of course in my actual working version the method is better, but I'll give Mr Anderson something to do besides copy & paste, so he can claim to be The Creator. EDIT By 'constants' I mean the two assignments after CONST. Edited February 20, 2007 by Petri 1 Quote Link to comment
alexrv Posted February 20, 2007 Author Share Posted February 20, 2007 Petri, Thanks for the script but how do I implement it? I'm a script newbie. I don't even know how to begin. I go into script editor and then what? Quote Link to comment
Vectorworks, Inc Employee Robert Anderson Posted February 22, 2007 Vectorworks, Inc Employee Share Posted February 22, 2007 Alex, copy Petri's script. Then create and name a new VectorScript resource using the Resource editor. When the VS editor window opens, paste his script into it. Now you have a "Document script" (one that is saved with your document as a resource). All docuemnt scripts are contained in "script palettes" (you will have created a script palette to make your script itself in the resource editor). To run a script from the script palette, just double-click it. HTH, Robert Quote Link to comment
Petri Posted February 22, 2007 Share Posted February 22, 2007 I should have thought this before: one may want to have a class prefix like "PLANTS-" Add that in constants: prefix = "PLANTS-"; then change theClass:=GETRFIELD(h, rName, fName); to be theClass:=CONCAT(prefix, GETRFIELD(h, rName, fName)); A palette script is definitely easier to create (and to modify for different needs) than a menu command. A palette can be imported to new files. Quote Link to comment
Guest Posted February 23, 2007 Share Posted February 23, 2007 I think the Plant Database requires some refinements to enable users to more easily grab groups of Plants as they wish. For example when creating reports - Plant Legends as I call them. Sometimes I may wish to have say Trees, Shrubs and Groundcovers each under their own headings. It may be difficult to implement - I do not know - within the Plant Database we need a user definable set of records rather than the Categorys as supplied by VW within the Database. In Oz Julian has done things a little differently and it works better. Quote Link to comment
alexrv Posted March 6, 2007 Author Share Posted March 6, 2007 In trying to get the script to recognize the plant category, the plants that I put on the drawing doesn't seem to pick up the proper plant category. It just list "plant category" in the field in the oip>data tab. So I go in the plant's definition to check if the plant cat. is selected appropriately and it is and so i click all the oks to go back to the drawing and now it is updated in the oip. I don't want to have to do this for each plant that I introduce to the drawing. Is there a way to streamline this? Am I applying the script wrong? Quote Link to comment
Petri Posted March 6, 2007 Share Posted March 6, 2007 Well, somehow you have to tell the system what the type of each plant is - tree, shrub, perennial or whatever. The script is for those situations where the type or category is in the database. If it isn't, then it won't be helpful at 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.