army_85 Posted October 6, 2009 Posted October 6, 2009 hi every one i used autocad for design irrigation layout landscape and i want lisp for divide on line put i want insert blocks too i want change point by block to come easy way like that --------------------------------------------- smiles like blocks all segment same plz help me in that thx Quote
ReMark Posted October 6, 2009 Posted October 6, 2009 Neither the Divide or Measure commands do what you want? Quote
army_85 Posted October 8, 2009 Author Posted October 8, 2009 i mean by divide commend div then enter then select object then block the name of block then number of segments its long stebs i want to learn how to make lisp or some one give me lisp of short way thx for you Quote
ReMark Posted October 8, 2009 Posted October 8, 2009 You can write a macro and have it pause for the name of the block and the number of segments. If the block name is always the same one, or a particular one you use often, create a macro specifically for it and have it pause only for the number of segments. Forget what I said. See below. Alanjt is da bomb! Quote
alanjt Posted October 8, 2009 Posted October 8, 2009 This is total garbage, but I had a few minutes to kill before time to go home and I was bored.... (defun c:DAC (/ ss point curve num dist lgth) (and (princ "\nSelect object(s) to divide along curve: ") (setq ss (ssget ":L")) (setq point (getpoint "\nBase point for objects: ")) (setq curve (car (entsel "\nSelect curve to divide: "))) (wcmatch (cdr (assoc 0 (entget curve))) "LINE,LWPOLYLINE,ARC") (setq num (getint "\nNumber of objects: ")) (setq num (1+ num)) (setq dist 0.0) (or (not (vl-catch-all-error-p (setq lgth (vl-catch-all-apply 'vla-get-length (list (vlax-ename->vla-object curve)))))) (not (vl-catch-all-error-p (setq lgth (vl-catch-all-apply 'vla-get-arclength (list (vlax-ename->vla-object curve)))))) ) ;(setq lgth (vla-get-length (vlax-ename->vla-object curve))) (while (< dist (- lgth (/ lgth num))) (vl-cmdf "_.copy" ss "" point (vlax-curve-getpointatdist curve (setq dist (+ dist (/ lgth num))))) ) ;_ while ) ;_ and (princ) ) ;_ defun Quote
army_85 Posted October 10, 2009 Author Posted October 10, 2009 hi but i didnt know how to write macro thx when i put this code thx this what i can do divide enter select object to divide: I CAN SELECT LINE .PLINE.ARC.ect enter the number of segments or {block}:block enter enter name of block to insert : ir enter ( it will be fixed) align block with object ? {yes/no} : yes enter enter the number of segments: 10 enter (it will be changed ) thx Quote
ReMark Posted October 10, 2009 Posted October 10, 2009 You don't have to write a macro just use the LISP routine alanjt wrote for you above. If you do not know how to use a LISP routine go to the CADTutor AutoCAD FAQ section of the forum and look under Customisation. Read the article entitled "How do I use an AutoLISP routine?". Quote
army_85 Posted October 10, 2009 Author Posted October 10, 2009 hi sorry remark i did it, i convert it to lisp but alanjt didnt wrot code right it didnt give me any help just select objects and number and no block or name of block did you know any way to help me to how can i write code what i want above how you writ code? i want lisp its ask me slect object like line or pline or ect and fixed block name and ask me about number only thx for help Quote
ReMark Posted October 10, 2009 Posted October 10, 2009 So you want a LISP routine and not a macro. I see. And you say you had a problem with alan"s code? The only thing I can do at the moment is download the lisp routine, run it on my computer and see what happens. Quote
alanjt Posted October 11, 2009 Posted October 11, 2009 hisorry remark i did it, i convert it to lisp but alanjt didnt wrot code right it didnt give me any help just select objects and number and no block or name of block did you know any way to help me to how can i write code what i want above how you writ code? i want lisp its ask me slect object like line or pline or ect and fixed block name and ask me about number only thx for help I never said it would do what you wanted. I was just playing around and thought I would post it. However, what I posted could easily be modifed to insert a block instead of just copying selected objects. Why not give it a try yourself. Quote
army_85 Posted October 11, 2009 Author Posted October 11, 2009 hi remark hi alanjt i tried by myself before but i didnt know the language of cods thx alanjt thx remark did you know how can i found cods of lizp language thx u Quote
ReMark Posted October 11, 2009 Posted October 11, 2009 Start with the AutoLISP, VBA forum. There are several threads about good sources for LISP routines and writing code. Quote
army_85 Posted October 13, 2009 Author Posted October 13, 2009 i got book The AutoLisp Tutorials Written and Compiled by Kenny Ramage but i didnt found more function for help on it so i didnt konw Quote
asanddune Posted May 30, 2010 Posted May 30, 2010 Have you learned the lisps? I did make this routines along time ago. Can send you again if you still need this didvide/ measure lisp. TC Quote
alanjt Posted May 30, 2010 Posted May 30, 2010 On a side note this is the origin of my CopyAlongCurve.LSP 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.