andy_lee Posted August 30, 2014 Share Posted August 30, 2014 (edited) Hi guys My English is very poor, so upload the image for explain. Draw arc on curve . (line, pline, circle, arc, ellipse) Can specify a starting point and end point and have a few options . Two kinds of type Type1 Type2 Direction, use dialog select If choose type1 ,so can use "Mouse gestures" to choose which side of the curve. Width and spacing, eg. width=2 ,spacing=1 Radian(%) Can also be fixed. like this: Edited September 1, 2014 by andy_lee Quote Link to comment Share on other sites More sharing options...
pBe Posted August 30, 2014 Share Posted August 30, 2014 Andy, From the looks of it, the routine were already done by somebody else, where did you get those pix on your post? Quote Link to comment Share on other sites More sharing options...
andy_lee Posted August 30, 2014 Author Share Posted August 30, 2014 Andy, From the looks of it, the routine were already done by somebody else, where did you get those pix on your post? Dear pBe. Haven't seen similar application. I use ODCL and PS draw that dialog. Quote Link to comment Share on other sites More sharing options...
pBe Posted August 30, 2014 Share Posted August 30, 2014 Dear pBe.Haven't seen similar application. I use ODCL and PS draw that dialog. You had me there andy, clever. Maybe I'll have a look later Quote Link to comment Share on other sites More sharing options...
andy_lee Posted August 31, 2014 Author Share Posted August 31, 2014 You had me there andy, clever. Maybe I'll have a look later Haha.Let your joking. If someone can help . I will be very happy. Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted September 1, 2014 Share Posted September 1, 2014 If manually we make a block with arc then command: Measure or command: Divide correct? can you clarify radian%? Quote Link to comment Share on other sites More sharing options...
andy_lee Posted September 1, 2014 Author Share Posted September 1, 2014 If manually we make a block with arcthen command: Measure or command: Divide correct? can you clarify radian%? Thank you for your reply , my friend han. radian It's not important. can replace like this: why need make block ? I think can use entmake create . Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted September 1, 2014 Share Posted September 1, 2014 why need make block ? I think can use entmake create . you misunderstood, what i mean if manually (without coding) using command: measure (with block), yes entmake is part of coding to be manipulated in polyline alignment Quote Link to comment Share on other sites More sharing options...
pBe Posted September 1, 2014 Share Posted September 1, 2014 you misunderstood, what i mean if manually (without coding) using command: measure (with block), That could work, perhaps with using dynamic blocks Quote Link to comment Share on other sites More sharing options...
andy_lee Posted September 1, 2014 Author Share Posted September 1, 2014 (edited) Hi my friend han. Maybe refer to this routine http://bbs.mjtd.com/thread-101300-1-1.html [color=#000000](defun C:SM (/ A AN AN0 BASEPT BETWEEN BOOL CURVEBLOCK CURVELENGTH DISTANC EN FIRSTPOINT LASTB LASTBLIST LASTBLOCK N PP PT PT0 SSADD1 STRIN TRIN VT)[/color] [color=#000000] (defun *error* (msg)[/color] [color=#000000] (vl-bt)[/color] [color=#000000] (if[/color][color=#000000] [/color][color=#000000]*DOC*[/color] [color=#000000] (_EndUndo *DOC*)[/color][color=#000000] [/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] )[/color] [color=#000000] (while (not (equal (getvar "cmdnames") "")) (command nil))[/color] [color=#000000] (princ "\n Error!")[/color] [color=#000000] (princ)[/color] [color=#000000] )[/color] [color=#000000] (defun stratpointT (en pt0 / CURVELENGTH L1)[/color] [color=#000000] (setq CurveLength[/color] [color=#000000] [/color][color=#000000] (vlax-curve-getDistAtParam[/color] [color=#000000] [/color][color=#000000] en[/color] [color=#000000] [/color][color=#000000] (vlax-curve-getEndParam en)[/color] [color=#000000] [/color][color=#000000] )[/color] [color=#000000] )[/color] [color=#000000] (setq L1 (vlax-curve-getDistAtPoint en pt0))[/color] [color=#000000] (< L1 (- CurveLength L1))[/color] [color=#000000] )[/color] [color=#000000] (defun NAME_BLK (CurveLength / A Y)[/color] [color=#000000] (setq A (rtos (* (getvar "CDATE") 1E8)))[/color] [color=#000000] (setq Y (/ CurveLength 5.0))[/color] [color=#000000] (entmake (list '(0 . "LINE")[/color] [color=#000000] [/color][color=#000000] [/color][color=#000000] (cons 10 (list 0 0 0))[/color] [color=#000000] [/color][color=#000000] [/color][color=#000000] (cons 11 (list 0 y 0))[/color] [color=#000000] [/color][color=#000000] )[/color] [color=#000000] )[/color] [color=#000000] (command "_.BLOCK"[/color] [color=#000000] [/color][color=#000000] A[/color] [color=#000000] [/color][color=#000000] "non"[/color] [color=#000000] [/color][color=#000000] (list 0 (/ y 2.0) 0)[/color] [color=#000000] [/color][color=#000000] (entlast)[/color] [color=#000000] [/color][color=#000000] ""[/color] [color=#000000] )[/color] [color=#000000] A[/color] [color=#000000] )[/color] [color=#000000] (defun MyAttAdd (en n / ELIST N1 N3 NEND QIANZ STREND TEXT)[/color] [color=#000000] (setq elist (entget (entnext en)))[/color] [color=#000000] (setq text (cdr (assoc 1 elist)))[/color] [color=#000000] (setq n3 (strlen text))[/color][color=#000000] [/color][color=#000000] [/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] (setq strEND (getNumberS text))[/color][color=#000000] [/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] (setq Nend (nth (1- (length strEND)) strEND))[/color] [color=#000000] (setq n1 (strlen Nend))[/color][color=#000000] [/color][color=#000000] [/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] (setq qianZ (substr text 1 (- n3 n1)))[/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] (setq strEND (+ (atof (car strEND)) n))[/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] (setq strEND (strcat qianZ (rtos strEND 2 3)))[/color] [color=#000000] (entmod (subst (cons 1 strEND) (assoc 1 elist) elist))[/color] [color=#000000] (entupd en)[/color] [color=#000000] [/color] [color=#000000] )[/color] [color=#000000] (defun MyTextAdd (en n / ELIST N1 N3 NEND QIANZ STREND TEXT)[/color] [color=#000000] (setq elist (entget en))[/color] [color=#000000] (setq text (cdr (assoc 1 elist)))[/color] [color=#000000] (setq n3 (strlen text))[/color][color=#000000] [/color][color=#000000] [/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] (setq strEND (getNumberS text))[/color][color=#000000] [/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] (setq Nend (nth (1- (length strEND)) strEND))[/color] [color=#000000] (setq n1 (strlen Nend))[/color][color=#000000] [/color][color=#000000] [/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] (setq qianZ (substr text 1 (- n3 n1)))[/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] (setq strEND (+ (atof (car strEND)) n))[/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] (setq strEND (strcat qianZ (rtos strEND 2 3)))[/color] [color=#000000] (entmod (subst (cons 1 strEND) (assoc 1 elist) elist))[/color] [color=#000000] )[/color] [color=#000000] [/color] [color=#000000] (vl-load-com)[/color] [color=#000000] (or *DOC*[/color] [color=#000000] (setq *DOC* (vla-get-ActiveDocument (vlax-get-acad-object)))[/color] [color=#000000] )[/color] [color=#000000] (_StartUndo *DOC*)[/color] [color=#000000] (setvar "nomutt" 1)[/color] [color=#000000] (princ "\n >Select the curve")[/color] [color=#000000] (while (not[/color] [color=#000000] [/color][color=#000000] (and[/color][color=#000000] [/color][color=#000000](setq en (ssget ":E:S" '((0 . "*LINE,ARC,ELLIPSE"))))[/color] [color=#000000] [/color][color=#000000] [/color][color=#000000](setq en (ssname en 0))[/color] [color=#000000] [/color][color=#000000] )[/color] [color=#000000] [/color][color=#000000] )[/color] [color=#000000] (princ "\n >Re select the curve")[/color] [color=#000000] )[/color] [color=#000000] (setvar "nomutt" 0)[/color] [color=#000000] (setq pt0 (vlax-curve-getClosestPointTo en (cadr (grread T )))[/color] [color=#000000] [/color] [color=#000000] (setq[/color][color=#000000] [/color][color=#000000]CurveLength[/color] [color=#000000] [/color][color=#000000] (vlax-curve-getDistAtParam[/color] [color=#000000] [/color][color=#000000] en[/color] [color=#000000] [/color][color=#000000] (vlax-curve-getEndParam en)[/color] [color=#000000] [/color][color=#000000] )[/color] [color=#000000] )[/color] [color=#000000] (setq[/color][color=#000000] [/color][color=#000000]curveBlock[/color] [color=#000000] [/color][color=#000000] (car (ENTSEL "\n ..>>Select the arrangement of objects along:"))[/color] [color=#000000] )[/color] [color=#000000] (if curveBlock[/color] [color=#000000] nil[/color] [color=#000000] (progn (setq A (NAME_BLK CurveLength))[/color] [color=#000000] [/color][color=#000000] (command "_.INSERT" A "@" "" "" "")[/color] [color=#000000] [/color][color=#000000] (setq lastblock (entlast))[/color] [color=#000000] [/color][color=#000000] (setq curveBlock lastblock)[/color] [color=#000000] )[/color] [color=#000000] )[/color] [color=#000000] (setq an0 (entget curveBlock))[/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] (setq basePt (cdr (assoc 10 an0)))[/color] [color=#000000] (setq an0 (cdr (assoc 50 an0)))[/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] [/color] [color=#000000] (setq bool T)[/color] [color=#000000] (setq[/color][color=#000000] [/color][color=#000000]strin (strcat "\n ...>>>The length of the curve"[/color] [color=#000000] [/color][color=#000000] [/color][color=#000000] (rtos CurveLength 2 3)[/color] [color=#000000] [/color][color=#000000] [/color][color=#000000] ",Enter the spacing: "[/color] [color=#000000] [/color][color=#000000] )[/color] [color=#000000] )[/color] [color=#000000] (while bool[/color] [color=#000000] (initget 7)[/color] [color=#000000] (setq between (getreal strin))[/color] [color=#000000] (if[/color][color=#000000] [/color][color=#000000](> between CurveLength)[/color] [color=#000000] (progn (setq bool T) (alert "Object spacing must be smaller than the curve length!!!"))[/color] [color=#000000] (setq bool nil)[/color] [color=#000000] )[/color] [color=#000000] )[/color] [color=#000000] (initget 4)[/color] [color=#000000] (setq strin (rtos (/ (rem CurveLength between) 2.0) 2 3))[/color] [color=#000000] (setq[/color] [color=#000000] distanc (getreal[/color] [color=#000000] [/color][color=#000000] (strcat "\n ....>>>>The spacing of first object & Curve endpoint<" strin ">:")[/color] [color=#000000] [/color][color=#000000] )[/color] [color=#000000] )[/color] [color=#000000] (if distanc[/color] [color=#000000] nil[/color] [color=#000000] (setq distanc (/ (rem CurveLength between) 2.0))[/color] [color=#000000] )[/color] [color=#000000] [/color] [color=#000000] (setq n (fix (/ (- CurveLength distanc) between)))[/color] [color=#000000] (if (stratpointT en pt0)[/color] [color=#000000] (setq firstPoint distanc)[/color] [color=#000000] (setq firstPoint (rem (- CurveLength distanc) between))[/color] [color=#000000] )[/color] [color=#000000] (setq ssadd1 (ssadd))[/color] [color=#000000] (repeat (setq n (1+ n))[/color] [color=#000000] (setq pt (vlax-curve-getPointAtDist en firstPoint)[/color] [color=#000000] [/color][color=#000000] pp (vlax-curve-getParamAtPoint en Pt)[/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] [/color][color=#000000] vt (vlax-curve-getFirstDeriv en pp)[/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] [/color][color=#000000] an (angle '(0 0 0) vt)[/color][color=#000000] [/color][color=#000000] [/color][color=#000000] [/color] [color=#000000] )[/color] [color=#000000] (command "._copy" curveBlock "" "non" basePt "non" PT)[/color] [color=#000000] (setq LastB (entlast))[/color] [color=#000000] (setq LastBList (entget LastB))[/color] [color=#000000] (cond ((assoc 66 LastBList) (MyAttAdd LastB (setq n (1- n))))[/color] [color=#000000] [/color][color=#000000] ((equal (cdr (assoc 0 LastBList)) "TEXT")[/color] [color=#000000] [/color][color=#000000] (MyTextAdd LastB (setq n (1- n)))[/color] [color=#000000] [/color][color=#000000] )[/color] [color=#000000] )[/color] [color=#000000] ;;(entmod (subst (cons 50 an) (assoc 50 LastBList) LastBList))[/color] [color=#000000] (command "_.rotate" LastB "" "non" pt (/ (* 180 (- an an0)) pi))[/color] [color=#000000] (setq ssadd1 (ssadd LastB ssadd1))[/color] [color=#000000] (setq firstPoint (+ firstPoint between))[/color] [color=#000000] )[/color] [color=#000000] (if lastblock[/color] [color=#000000] (command "._erase" lastblock "")[/color] [color=#000000] (progn (initget "R ")[/color] [color=#000000] [/color][color=#000000] (setq trin[/color] [color=#000000] [/color][color=#000000] [/color][color=#000000] (getstring "\nTo block rotated 180 degrees, input R<Enter>")[/color] [color=#000000] [/color][color=#000000] )[/color] [color=#000000] [/color][color=#000000] (if (or (equal trin "R") (equal trin "r"))[/color] [color=#000000] [/color][color=#000000] (repeat (setq n (sslength ssadd1))[/color] [color=#000000] [/color][color=#000000] (setq LastB (ssname ssadd1 (setq n (1- n))))[/color] [color=#000000] [/color][color=#000000] (setq LastBList (entget LastB))[/color] [color=#000000] [/color][color=#000000] (setq an (cdr (assoc 50 LastBList)))[/color] [color=#000000] [/color][color=#000000] (setq an (+ an pi))[/color] [color=#000000] [/color][color=#000000] (entmod (subst (cons 50 an) (assoc 50 LastBList) LastBList))[/color] [color=#000000] [/color][color=#000000] )[/color] [color=#000000] [/color][color=#000000] )[/color] [color=#000000] )[/color] [color=#000000] )[/color] [color=#000000] (_EndUndo *DOC*)[/color] [color=#000000] (princ)[/color] [color=#000000])[/color] [color=#000000](defun _StartUndo (*DOC*)[/color] [color=#000000] (_EndUndo *DOC*)[/color] [color=#000000] (vla-StartUndoMark *DOC*)[/color] [color=#000000])[/color] [color=#000000](defun _EndUndo[/color][color=#000000] [/color][color=#000000](*DOC*)[/color] [color=#000000] (if (= 8 (logand 8 (getvar 'UNDOCTL)))[/color] [color=#000000] (vla-EndUndoMark *DOC*)[/color] [color=#000000] )[/color] [color=#000000])[/color] Edited September 1, 2014 by andy_lee Quote Link to comment Share on other sites More sharing options...
andy_lee Posted September 1, 2014 Author Share Posted September 1, 2014 Can specify a starting point and end point . Is this a problem? Quote Link to comment Share on other sites More sharing options...
troggarf Posted September 1, 2014 Share Posted September 1, 2014 If you can create the objects, use the following routine http://www.theswamp.org/index.php?topic=32789.0 I see that you are using AutoCAD 2010 - Newer versions have a new ARRAYPATH command that can do something similar to this. But if you can simply draw the arc, then use thew above routine you should be good... Quote Link to comment Share on other sites More sharing options...
andy_lee Posted September 1, 2014 Author Share Posted September 1, 2014 If you can create the objects, use the following routine http://www.theswamp.org/index.php?topic=32789.0 I see that you are using AutoCAD 2010 - Newer versions have a new ARRAYPATH command that can do something similar to this. But if you can simply draw the arc, then use thew above routine you should be good... Thank you! troggarf. I've seen that routine. it's great. This is a big difference to me. I think specify a starting point and end point is a difficult problem . 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.