NVP Posted June 6, 2016 Posted June 6, 2016 Hello folks. I'm glad to finally join the forum, I've noticed there are some true CAD wizards here . I have a bit of a complex problem I can't quite solve myself right now. I need to automate/shortcut the Dataextraction wizard in AutoCAD using a LISP program. Preferably I'd like to do this in a way that can be used in LT as well. Specifically (for the filters), I need the Dataextraction function to count the number of polylines on a specified layer, while extracting objects from blocks, from a selection that I can either make before I run the program or during the operation. I then need the count of polylines to output to a table inside of CAD, the same way Dataextraction does. Ideally, I'd like to have the program autoselect the region for me by referencing the area within a specific rectangular polyline/block that will remain the same across all of my CAD files via a template. I've done some tinkering with LISP programs and have one that can select everything within the bounds of a polyline, but it's not enough for this. Any help would be much appreciated. Quote
Dadgad Posted June 6, 2016 Posted June 6, 2016 Welcome to CADTutor. Your profile says that you are using LT. is that correct? I ask because, as I understand it, LT is not Lisp compatible. If your profile is inaccurate, please correct it, as nobody is likely to help you create a lisp which you won't be able to use. For good reason. Quote
NVP Posted June 6, 2016 Author Posted June 6, 2016 Welcome to CADTutor. Your profile says that you are using LT. is that correct? I ask because, as I understand it, LT is not Lisp compatible. If your profile is inaccurate, please correct it, as nobody is likely to help you create a lisp which you won't be able to use. For good reason. Thank you for the hint. I typically use LT, but I have access to the full version of CAD as well. Quote
BIGAL Posted June 7, 2016 Posted June 7, 2016 Ok some simple answers using ssget in a lisp you can add pline & layer filter and sslength is how many. Adding to table again no problem. Again Again within a predefined area no problem. ; an example (setq win (list 0,0 100,100)) ; window size also see help for CP WP (setq wbox (list 0,0 100,0 100,100 0,100)) (setq ss (ssget "W" '(0 0) '(100 100) (list (cons 8 "layername")(cons 0 "LWPOLYLINE")))) (alert (strcat "There is " (rtos (sslength ss) 2 0) "Plines")) 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.