Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted
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.

Posted

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"))

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...