Allan B. Posted February 3, 2022 Posted February 3, 2022 The list of objects that I copy from a existing list needs to put into a selection set that I can manipulate them in an optimization program. I have tied to do this inside a foreach function but I keep failing at the syntax. Example (foreach pt (last optlist)(command "copy" pt "" baspt despt) ; now create the selection set and number it for later placement ) The optlist can contain anywhere from 2 to 5 objects, in the selection set I need to optimize their placement with another placement, rotate, move.This is all done automatically in another lisp routine. I will try later to copy a cad drawing to this site for a better understanding . Allan Quote
Allan B. Posted February 3, 2022 Author Posted February 3, 2022 I have just added a stsample .dwg to my post. Here you can see how I optimize my tread placement. The new selection set I hope will allow me to place drill patterns on the optimized plates. Allan stsample.dwg Quote
mhupp Posted February 4, 2022 Posted February 4, 2022 In this case we need to know how optlist is generated and/or what its made up of. I myself prefer to use the foreach function. If its a selection set. (foreach ent (mapcar 'cadr (ssnamex SS)) ;used with ssget "_X" ;code here .... ) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) ;all other ssget's ;code here .... ) with lists its even simpler. (foreach pt optlist (command "copy" pt "" baspt despt) ... ) For this to work optlist would have to be entity names in that list (<Entity name: 3820ff80> <Entity name: 3820e640> <Entity name: 3820e180> <Entity name: 3820dd80> <Entity name: 3820dec0>) Quote
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.