smorales02 Posted August 8, 2008 Share Posted August 8, 2008 Did a quick search and couldnt come up with anything so I thought I might post... I am wanting to be able to click on a line and have ACAD give me the Slope of the line...Is there something in ACAD that already does that and I just cant find it??? any help would be appreciated.. Quote Link to comment Share on other sites More sharing options...
lpseifert Posted August 8, 2008 Share Posted August 8, 2008 In plan or profile? Quote Link to comment Share on other sites More sharing options...
smorales02 Posted August 8, 2008 Author Share Posted August 8, 2008 profile.....sorry guess I should have mentioned that... Quote Link to comment Share on other sites More sharing options...
CmdrDuh Posted August 8, 2008 Share Posted August 8, 2008 if you use distance it will give you the delta X and delta Y. You could write a quick little program to automate that also Quote Link to comment Share on other sites More sharing options...
lpseifert Posted August 8, 2008 Share Posted August 8, 2008 try this ;;;returns slope of line/polyline LPS 2008 w/help from ronjomp @ The Swamp (defun c:sl () (vl-load-com) (setq ent (entsel)) (if (= (cdr (assoc 0 (entget (car ent)))) "LINE") (progn (setq lst (entget (car ent)) pt1 (cdr (assoc 10 lst)) pt2 (cdr (assoc 11 lst)) x1 (car pt1) y1 (cadr pt1) x2 (car pt2) y2 (cadr pt2) dy (- y2 y1) dx (- x2 x1) slp (* 100 (/ dy dx)) txtx (rtos (abs dx) 2 2) txty (rtos dy 2 2) txts (rtos slp 2 2) ) ;setq ) ;progn (progn (setq pt (osnap (cadr ent) "nea") ent (car ent) ) ;setq (defun getadjacentplinevertices (ent pt / i p1 p2) (if (= (cdr (assoc 0 (entget ent))) "LWPOLYLINE") (progn (setq i (fix (vlax-curve-getParamAtPoint ent (vlax-curve-getClosestPointTo ent pt) ) ) p1 (vlax-curve-getPointAtParam ent i) p2 (vlax-curve-getPointAtParam ent (+ 1 i)) ) (setq ls1 (list p1 p2)) ) ;progn ) ;if ) ;defun (getadjacentplinevertices ent pt) (setq p1x (car (car ls1)) p1y (cadr (car ls1)) p2x (car (cadr ls1)) p2y (cadr (cadr ls1)) dx (- p2x p1x) dy (- p2y p1y) slp (* 100 (/ dy dx)) slp2 (/ dx dy) txtx (rtos (abs dx) 2 2) txty (rtos dy 2 2) txts (rtos slp 2 2) txts2 (rtos slp2 2 2) ) ;setq ) ;progn ) ;if (prompt (strcat "\nHorizontal distance = " txtx "'" "\nRelief = " txty "'" "\nSlope is " txts "%..." txts2 ":1") ) (princ) ) Quote Link to comment Share on other sites More sharing options...
smorales02 Posted August 8, 2008 Author Share Posted August 8, 2008 returns this error message when I select my line.. Select object: ; error: bad argument type: stringp nil Quote Link to comment Share on other sites More sharing options...
lpseifert Posted August 8, 2008 Share Posted August 8, 2008 I don't know what to tell you... I just copy/pasted the code into the Visual Lisp Editor, loaded and ran it and it worked fine. Anybody else try it and have problems? Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 9, 2008 Share Posted August 9, 2008 i could swear that's built into ldd. i know i've used it before. Quote Link to comment Share on other sites More sharing options...
lpseifert Posted August 9, 2008 Share Posted August 9, 2008 In C3D there's Inquiry > List Slope but it only works for lines (no plines) in plan view. Quote Link to comment Share on other sites More sharing options...
rustysilo Posted August 10, 2008 Share Posted August 10, 2008 Do you have Civil Design installed with Land? Quote Link to comment Share on other sites More sharing options...
Strix Posted August 10, 2008 Share Posted August 10, 2008 doesn't PROPERTIES tell you it's ANGLE? Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 10, 2008 Share Posted August 10, 2008 Do you have Civil Design installed with Land? i think from 06 and up, land is a addon for C3D. can't have it w/o C3D. Quote Link to comment Share on other sites More sharing options...
rustysilo Posted August 10, 2008 Share Posted August 10, 2008 Civil Design is an add-on for Land Desktop (and Land Development Desktop prior). Land Desktop is a stand-alone product for survey and civil applications. Civil 3d is the newer product released in '04 I believe. It was meant to replace the Land Desktop and Civil Design package and it now has. Up through the '08 release Land Desktop was sold or given along with a Civil 3d seat as a "companion product" just until the development of Civil 3d was more complete and could perform all of the duties that the old Land/Civil package did. I believe Land Desktop and Civil Design are now pretty much finished. Civil Design was for engineers to do the actual design work with profiles and pipes, etc. I don't recall if Land has the abilities to do the slope labels or if it was the Civil Design add-on that gave this functionality. Have you tried searching the help file? If I were at work I could check on this for you, but what with it being Sunday I don't have access to Land. Quote Link to comment Share on other sites More sharing options...
rustysilo Posted August 11, 2008 Share Posted August 11, 2008 OK I'm at work now. It appears that the Profiles menu is part of the Civil Design add-on so if you only have Land then you probably would have to go with the previous lisp or equivalent. With Civil Design you would label it by going to Profiles > Label > Tangents Quote Link to comment Share on other sites More sharing options...
filan1a Posted August 11, 2008 Share Posted August 11, 2008 try this ;;;returns slope of line/polyline LPS 2008 w/help from ronjomp @ The Swamp (defun c:sl () (vl-load-com) (setq ent (entsel)) (if (= (cdr (assoc 0 (entget (car ent)))) "LINE") (progn (setq lst (entget (car ent)) pt1 (cdr (assoc 10 lst)) pt2 (cdr (assoc 11 lst)) x1 (car pt1) y1 (cadr pt1) x2 (car pt2) y2 (cadr pt2) dy (- y2 y1) dx (- x2 x1) slp (* 100 (/ dy dx)) txtx (rtos (abs dx) 2 2) txty (rtos dy 2 2) txts (rtos slp 2 2) ) ;setq ) ;progn (progn (setq pt (osnap (cadr ent) "nea") ent (car ent) ) ;setq (defun getadjacentplinevertices (ent pt / i p1 p2) (if (= (cdr (assoc 0 (entget ent))) "LWPOLYLINE") (progn (setq i (fix (vlax-curve-getParamAtPoint ent (vlax-curve-getClosestPointTo ent pt) ) ) p1 (vlax-curve-getPointAtParam ent i) p2 (vlax-curve-getPointAtParam ent (+ 1 i)) ) (setq ls1 (list p1 p2)) ) ;progn ) ;if ) ;defun (getadjacentplinevertices ent pt) (setq p1x (car (car ls1)) p1y (cadr (car ls1)) p2x (car (cadr ls1)) p2y (cadr (cadr ls1)) dx (- p2x p1x) dy (- p2y p1y) slp (* 100 (/ dy dx)) slp2 (/ dx dy) txtx (rtos (abs dx) 2 2) txty (rtos dy 2 2) txts (rtos slp 2 2) txts2 (rtos slp2 2 2) ) ;setq ) ;progn ) ;if (prompt (strcat "\nHorizontal distance = " txtx "'" "\nRelief = " txty "'" "\nSlope is " txts "%..." txts2 ":1") ) (princ) ) it doesn work with autocad2006 it returns error: Select object: ; error: bad argument type: stringp nil Quote Link to comment Share on other sites More sharing options...
rustysilo Posted August 11, 2008 Share Posted August 11, 2008 Maybe try HawsEDC Tools? Quote Link to comment Share on other sites More sharing options...
smorales02 Posted August 11, 2008 Author Share Posted August 11, 2008 Thanks for all the inout guys, i will be trying them as soon as I get some time. Quote Link to comment Share on other sites More sharing options...
BOB'27T Posted August 13, 2008 Share Posted August 13, 2008 Here's a dumb question. What is the command prompt that I need to type in for this lisp. Is it LPS? Quote Link to comment Share on other sites More sharing options...
lpseifert Posted August 13, 2008 Share Posted August 13, 2008 SL ...FYI it's what comes after (defun c: Quote Link to comment Share on other sites More sharing options...
BOB'27T Posted August 13, 2008 Share Posted August 13, 2008 Thanks! See I told you it was a dumb question! It worked out perfect on C3D '09. 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.