kkr028 Posted March 4, 2022 Posted March 4, 2022 Please help me poly line length from start with Curve up to tp-1(+) from tp-1 to IP distace (place as apex at km ? Quote
mhupp Posted March 4, 2022 Posted March 4, 2022 (edited) Rather then doing stupid math why not just make a copy then fillet with radius 0. (setq poly (vlax-invoke (vlax-ename->vla-object ent) 'copy)) (setvar 'filletrad 0) (vl-cmdf "_.Fillet" "P" (entlast)) Then its just 1+2 & 1+2+3 --EDIT Then delete poly when done Edited March 4, 2022 by mhupp 1 Quote
Steven P Posted March 4, 2022 Posted March 4, 2022 (edited) 3 hours ago, mhupp said: Rather then doing stupid math why not just make a copy then fillet with radius 0. (setq poly (vlax-invoke (vlax-ename->vla-object ent) 'copy)) (setvar 'filletrad 0) (vl-cmdf "_.Fillet" "P" (entlast)) Then its just 1+2 & 1+2+3 --EDIT Then delete poly when done Just for fun... or like this if your lines are not polylines? (defun c:testthis ( / ) (setq frad (getvar 'filletrad)) (setq line1 (car (entsel "\nSelect Line 1"))) (setq line2 (car (entsel "\nSelect Line 2"))) (setq pta (cdr (assoc 10 (entget line1))) ) (setq ptb (cdr (assoc 11 (entget line1))) ) (setq ptc (cdr (assoc 10 (entget line2))) ) (setq ptd (cdr (assoc 11 (entget line2))) ) (command "pline" pta ptb "") (setq pline1 entlast) (command "pline" ptc ptd "") (setq pline2 entlast) (setvar 'filletrad 5) (command "fillet" pta ptc) (setvar 'filletrad frad) (setq pline3 (entlast)) (setq length1 (vlax-curve-getDistAtParam pline3 (vlax-curve-getEndParam pline3 )) ) (entdel pline3) (princ "\Length: ") (princ length1) (princ) ) Edited March 4, 2022 by Steven P 1 Quote
Tharwat Posted March 4, 2022 Posted March 4, 2022 My attempt. (defun c:Apex ( / sel pts pt1 pt2 pt3 pt4 pt5 pt6 sg1 sg2) ;; Tharwat - 5.Mar.2022 ;; (and (princ "\nSelect LWpolyline : ") (setq sel (ssget "_+.:S:E" '((0 . "LWPOLYLINE")))) (mapcar '(lambda (q) (and (= (car q) 10) (setq pts (cons (cdr q) pts)))) (reverse (entget (ssname sel 0)))) (or (< 5 (length pts)) (alert "Polyline should have at least 6 vertices to continue <!>") ) (mapcar 'set '(pt1 pt2 pt3 pt4 pt5 pt6) pts) (setq sg1 (distance pt1 (inters pt1 pt2 pt4 pt3 nil)) g2 (+ (distance pt1 pt2) (distance pt3 (inters pt3 pt4 pt6 pt5 nil))) ) ) (list sg1 sg2) ) 2 Quote
BIGAL Posted March 4, 2022 Posted March 4, 2022 As a civil engineer there is a formula for the solution of IP point, so could do pick arc or pick arc in pline. Quote
Steven P Posted March 5, 2022 Posted March 5, 2022 Coming back to this quickly, if the OP has a 'U' shaped polyline, with 2 or more filleted corners just selecting the polyline isn't going give the required apex ? I read the question wrong last night and what I posted above isn't quite what is needed, I'll look at this later 1 Quote
exceed Posted March 5, 2022 Posted March 5, 2022 (edited) this will help you little bit make polyline's curve to straight even if curves are in end of polyline also there's one problem with exist lisp which make radius to 0 value in end of polyline Edited March 5, 2022 by exceed Quote
BIGAL Posted March 6, 2022 Posted March 6, 2022 Steven P you can check which segment of a pline you picked so can get arc in pline. No code but big hint is Lee-mac pline properties. 1 Quote
kkr028 Posted March 17, 2022 Author Posted March 17, 2022 actually i need this TP1 length = Curve polyline length up to every TP-1 and place text as " TP-1@ ??.??? KM' " TP2 length = Curve polyline length up to every TP-2 and place text as " TP-2@ ??.??? KM' " APEX length = (Curve polyline length up to every TP-1 + tangent length and place text as " APEX-? AT ??.??? KM " FORWARD BARRING = place text as " FB : ???° ??' ?? " CURVE-Model.pdf Quote
SLW210 Posted March 17, 2022 Posted March 17, 2022 No need to create a couple of new threads. It took 2 weeks to respond and now you're in a hurry? Quote
tombu Posted March 17, 2022 Posted March 17, 2022 Try this code by ronjonp http://www.theswamp.org/index.php?topic=49865.msg551018#msg551018 I modified it slightly for my needs from his http://www.theswamp.org/index.php?topic=49865.msg550417#msg550417 1 Quote
ronjonp Posted March 17, 2022 Posted March 17, 2022 48 minutes ago, tombu said: Try this code by ronjonp http://www.theswamp.org/index.php?topic=49865.msg551018#msg551018 I modified it slightly for my needs from his http://www.theswamp.org/index.php?topic=49865.msg550417#msg550417 HA! I knew I had written something for this but couldn't find it! 2 Quote
tombu Posted March 17, 2022 Posted March 17, 2022 20 minutes ago, ronjonp said: HA! I knew I had written something for this but couldn't find it! Glad to help, it was easy to find as I've probably got as much of your code referenced in my CUIX as you do! I enjoy writing lisp as well but time is money. Anytime Google can find a quick solution online from a guru I trust it's added to my collection referenced to where and from whom I got it! Thanks again, 1 Quote
ronjonp Posted March 18, 2022 Posted March 18, 2022 3 hours ago, tombu said: Glad to help, it was easy to find as I've probably got as much of your code referenced in my CUIX as you do! I enjoy writing lisp as well but time is money. Anytime Google can find a quick solution online from a guru I trust it's added to my collection referenced to where and from whom I got it! Thanks again, Glad you could use the code I've provided. I'd hardly consider myself a 'guru' but thanks! Quote
kkr028 Posted March 22, 2022 Author Posted March 22, 2022 i need lisp for my problem. please help me out this Quote
tombu Posted March 22, 2022 Posted March 22, 2022 5 hours ago, kkr028 said: i need lisp for my problem. please help me out this Did you try the links I posted? https://www.theswamp.org/ is also a (donor supported) free site just like this one. Quote
kkr028 Posted March 23, 2022 Author Posted March 23, 2022 it is showing apex lines . i want label like in above image 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.