ccroft Posted September 9, 2005 Share Posted September 9, 2005 Hi Bob If you just can't get FEOIL to work you can write your own loops nested within loops: hgroup:=FInLayer(hlayer); WHILE hgroup <> NIL DO BEGIN hpart:=FInGroup(hgroup); WHILE hpart <> NIL DO BEGIN {do something;} hpart:=NextObj(hpart); End; hgroup:=NextObj(hgroup); End; This will do one referenced layer. You would need either another loop enclosing this to run thru all layers, or perhaps call this as the action function in ForEachOjectInList using Flayer for the list handle. I sometimes use this approach cause it's easier to see and control what's going on .... for me anyway. Charles Quote Link to comment
BobD Posted September 9, 2005 Author Share Posted September 9, 2005 Hello All, I have hierachical plug-in object where one parent includes a number of children objects. I need to traverse all the objects on a layer, do some calcs and then write an output file. I tried to use ForEachObjectInLayer to filter the objects by layer and at the same time get down into any hierarchy. It does not seem to work as it will only find the parent objects even with the correct object, traversal and layer options set. When set to look at all layers, I do get a list of objecthandles, but no names are returned. Anyone know how to get this to work? Without this capability, I have to manually ungroup each parent object prior to processing and then re-group them when done. Thanks for any input. Quote Link to comment
BobD Posted September 9, 2005 Author Share Posted September 9, 2005 Charles - Thanks - you have really helped me so much! I'll give it a shot. Bob Quote Link to comment
BobD Posted September 9, 2005 Author Share Posted September 9, 2005 Charles - Tried your suggestion. It does work in that I can get into the hierarchy, but still not getting any objectnames back so I cannot pull in the object params. Any idea why, if I can get a handle, I am not getting the name? Thanks, Bob Quote Link to comment
Vectorworks, Inc Employee klinzey Posted September 9, 2005 Vectorworks, Inc Employee Share Posted September 9, 2005 What function are you using to get the object names? Quote Link to comment
BobD Posted September 9, 2005 Author Share Posted September 9, 2005 Kevin, I am using GetName. I have tried just about every combination of FEOIList, FEOILayer, and the above suggested by Charles. The only thing that enables me to get a name is when I use ForEachObject and explicitly pass it a record name. Bob Quote Link to comment
ccroft Posted September 10, 2005 Share Posted September 10, 2005 "Function GetName returns the object name of the referenced object. The function returns None if the object has no object name" They do have names....right? I ask this because you do mention traversing groups. Groups don't have object names as far as I know. I use a number of symbols that are inserted as groups so they can be edited graphically. The name does not transfer from the symbol to the resultant group.The symbols have attached records and one of the fields is "Name". The record remains intact. Does this sounds familiar in any way? I imagine this same thing would happen if you're creating groups within your PIO. c. Quote Link to comment
BobD Posted September 12, 2005 Author Share Posted September 12, 2005 Charles, Perhaps GROUP is not the correct nomenclature. I have a plugin that contains parameters that I grab and then call CreateCustomObject from within the Plug In to create other objects. There are no explicit Group/End Group calls being made. When I run the plugin, and then display the layer, all the objects created within the parent plug in are grouped. I then have another plug in to do the traversal. Within the traversal program, I do a ForEachObject call for each plugin object created and supply criteria R=pluinobject_name & Layer= layername. Within VW, I display the layer with all the objects, run the traversal plug in, and, unless I explicity ungroup the parent object, I can not get the object names. If I do an ungroup, then I can get all the names and can do the traversal correctly. If I run VW export database and select one of the child records, the system can find all the child objects, even without doing an ungroup. If I run VW export vectorscript, it will not output the child records unless the ungroup is done. Whew! Bob Quote Link to comment
ccroft Posted September 13, 2005 Share Posted September 13, 2005 Nice explanation! This stuff can get hard to talk about. Questions: 1) What kind of objects are you using CCO to create inside the PIO? 2) What do you need their names for and how many different names are there? 3) Are the child records PIO parameter records or attached record objects you can access with the Data pane of Object Info? Quote Link to comment
BobD Posted September 14, 2005 Author Share Posted September 14, 2005 I am creating plugin objects from within the plugin. These consist of straightforward 2D parts to a typical door - stiles, rails, etc. I am using their names within the traversal code to recognize the particular part and generate a spec of the part in the output file. So, the children are all PIO parameter records. When I select the parent, I get it's object info. If I need to muck with the parts, I can ungroup the parent and select individual parts and get their info via object info. Quote Link to comment
ccroft Posted September 14, 2005 Share Posted September 14, 2005 I do this with cabinets, but I use classes to distinguish the parts.So I have 'fronts','bottom','drawer box', etc. The pio calls the class, creates the parts, calls the next class etc. I also sometimes use an attached record and pull a name off that. The difference is that my parent PIO contains only simple extrudes, rather than more PIO's. FEO finds my parts and recognizes by class.You might consider drawing your parts directly without using CreateCustom, and naming them by class assignment. This assumes that the only reason you're making the parts as PIO's is so they can carry a name. I also find this useful in that the graphic attributes of the parts can easily be controlled thru class attributes. I really don't understand why the ForEach calls don't get you the names of the kid PIO's though. Maybe you should post the script for the ActionFunction and the CreateCustomObject calls? I have zero experience with family style PIO's, but somebody here might be able to help if they can see your script. Later Charles Quote Link to comment
BobD Posted September 15, 2005 Author Share Posted September 15, 2005 Charles, Thanks again for all your helpful insights. I'll check into using classes. I see that Kevin from Nemetschek replied once but never got engaged again. I thought he might know what was up with GNO, FEOIL, etc... Bob Quote Link to comment
Vectorworks, Inc Employee klinzey Posted September 16, 2005 Vectorworks, Inc Employee Share Posted September 16, 2005 I'm kind of lost at the moment on the structure of the PIO. It sounds like a PIO that contains other PIO's. In order to get the name of a PIO look at the name of last record attatched to the object. It should be the name of the PIO. You can get the values from this record. If you are using criteria make sure you use INOBJECT so it will look inside of PIOs. Quote Link to comment
BobD Posted September 19, 2005 Author Share Posted September 19, 2005 Kevin and Charles, If I do a FEO with criteria INOBJECT and ALL, I can get all the objects and filter them out myself. Kevin's hint above about pulling the name from the last object was a big help. Thanks, Bob 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.