scottkelley80 Posted November 12, 2008 Share Posted November 12, 2008 I'm wanting to prepare quantities for a project based on what's drawn in CAD. Is there a way to select all similar lines and have CAD sum the lengths for me? Quote Link to comment Share on other sites More sharing options...
fuccaro Posted November 12, 2008 Share Posted November 12, 2008 What do you mean by "similar"? Lines on the same layer? Or drawn with a specific linetype? There are some ways. I would use some Lisps entered dirrectly in the command line. Quote Link to comment Share on other sites More sharing options...
scottkelley80 Posted November 12, 2008 Author Share Posted November 12, 2008 I need something that can just add the lines I select. Adding lines with similar linetypes and/or everything on the layer would be a bonus. Quote Link to comment Share on other sites More sharing options...
wannabe Posted November 12, 2008 Share Posted November 12, 2008 Well, you can use selection filters, or quick select. Theres also an audit function that may be helpful for blocks. EDIT: not audit, EATTEXT. Thinking of another program. This only solves half the problem though. Quote Link to comment Share on other sites More sharing options...
fuccaro Posted November 12, 2008 Share Posted November 12, 2008 A quick one: (defun c:total() (setq len 0) (while (setq l (entsel)) (setq len (+ len (distance (cdr (assoc 10 (setq lst (entget (car l))))) (cdr (assoc 11 lst)) ) ) ) ) (eval len) ) Also this could be helpfull: http://www.cadtutor.net/forum/showthread.php?t=1390 Quote Link to comment Share on other sites More sharing options...
scottkelley80 Posted November 12, 2008 Author Share Posted November 12, 2008 i haven't had much experience with creating lisp routines, you'll have to walk me through the process on that one, or point me in the right direction. Quote Link to comment Share on other sites More sharing options...
scottkelley80 Posted November 12, 2008 Author Share Posted November 12, 2008 Scratch the previous post, i went to the link. I got the routine to work, but I can't tell which lines i selected. Is there a way to modify the routine to dash the lines when selected? Quote Link to comment Share on other sites More sharing options...
fuccaro Posted November 18, 2008 Share Posted November 18, 2008 Here you are: (defun c:total() (setq len 0) (while (setq l (entsel)) (redraw (car l) 3) (setq len (+ len (distance (cdr (assoc 10 (setq lst (entget (car l))))) (cdr (assoc 11 lst)) ) ) ) ) (eval len) ) Also see the page I pointed you in the previous post; CADTutor showed us how to use Lisps by an example -and that is close to what you wish. Quote Link to comment Share on other sites More sharing options...
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.