PDA

View Full Version : Generate curve table



Dipen_n
2004-07-05, 05:40 AM
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

RobertB
2004-07-07, 08:19 PM
Would you be willing to learn how to do it?

Dipen_n
2004-07-08, 07:59 AM
YES BUT HOW??

RobertB
2004-07-09, 04:43 PM
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.

Dipen_n
2004-07-12, 05:17 AM
Thanks for your support, but i dont know anything else
than loading a lisp file

RobertB
2004-07-12, 06:10 PM
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.

(function? C:CurveTable ()
(function? inpPick (function?))
(princ)) ; clean exit (most programs end with this)

fute000709852
2015-09-29, 01:17 PM
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 ?

BIG-AL
2015-10-19, 08:14 AM
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



;;; 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)
)


ok know for step 1 pick an arc whats its radius thats your turn also startpoint endpoint


(defun c:test ()
(setq obj (vlax-Ename->Vla-Object (car (entsel))))
(alert (vla-get-objectname obj))
)

Tom Beauford
2015-10-19, 02:02 PM
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.