All the details are avialable in the attached file,
it would be very nice of you
if you can help me generate this curve table by selecting two end points of the curve
regards
dipen
![]() |
|
![]() |
|
![]() |
|
![]() |
All the details are avialable in the attached file,
it would be very nice of you
if you can help me generate this curve table by selecting two end points of the curve
regards
dipen
Good!
Ok, the first step is to create the command function and get the arc. You will need to use the Visual LISP functions defun, setq, and either entsel or ssget and ssname. The help files ought to help you understand how to use those functions.
Thanks for your support, but i dont know anything else
than loading a lisp file
Open the help files (F1, Developer's Guide, AutoLISP Reference) and read up on the functions I listed.
defun is how you will create a command-line function (think "command"). The function's name needs to start with C: to be recognized as a commnad-line function. Don't worry about declaring arguments/variables at this moment. The help files show how to use this function.
setq is used to store data in a variable (called a "symbol" in the help files). You will need to use variables to store data such as the arc the user selects.
enstsel is one function that allows the programmer to let the user select an object in AutoCAD. Or you could use ssget to make a selection set of what the user selects (the advantage being that you can "filter" what the user selects, to force them to pick only arcs).
So you need to use defun to "name" and start your program and setq to store what the user selects via the enstsel function.
Code:(function? C:CurveTable () (function? inpPick (function?)) (princ)) ; clean exit (most programs end with this)
I would, with some help.
I'm trying to develop a custom curve table, but don't know how to write code.
Would you be able to help me ?
Best thing is to understand what you can get from an object and arc has a few simple ones and using vl lisp is intuitive. Here is a program that you can use to see whats available
ok know for step 1 pick an arc whats its radius thats your turn also startpoint endpointCode:;;; Dump all methods and properties for selected objects ; ;;;===================================================================; ;;; DumpIt ; ;;;-------------------------------------------------------------------; ;;;===================================================================; (defun C:DumpIt ( / ent) (while (setq ent (entsel)) (vlax-Dump-Object (vlax-Ename->Vla-Object (car ent)) T ) ) (princ) )
Code:(defun c:test () (setq obj (vlax-Ename->Vla-Object (car (entsel)))) (alert (vla-get-objectname obj)) )
I wrote one many years ago when all we had was Vanilla AutoCAD. For selected arc segments it created a curve table, but labeled line segments. It requires a block for the table and another for the line label. You may need to add (vl-load-com) to the top of the file, I have that preloaded in acaddoc.lsp instead of adding it to every routine.
It uses textsize to scale the arc & line blocks, but I would use (/ 0.1 (getvar 'cannoscalevalue)) in place of (getvar "TEXTSIZE") today. It works with polyline segments as well. You will need to enter the chainage for the PC, but everything else should be calculated from the arc segment. You would have to modify it for your needs.