Jump to content

Recommended Posts

Posted

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

Posted

Neither the Divide or Measure commands do what you want?

Posted

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

Posted

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!

Posted

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

Posted

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

Posted

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?".

Posted

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

Posted

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.

Posted
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

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.

Posted

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

Posted

Start with the AutoLISP, VBA forum. There are several threads about good sources for LISP routines and writing code.

Posted

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

  • 7 months later...
Posted

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

Posted

holy20thread20resurrection.jpg

 

 

 

 

 

On a side note this is the origin of my CopyAlongCurve.LSP :wacko:

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...