Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

divide multiple lines

ruirego
Enthusiast

divide multiple lines

ruirego
Enthusiast
Enthusiast

hello, any way to select several lines and divide all? now that Autocad Mac as LISP maybe its possible!?

 

thanks

R^2 

0 Me gusta
Responder
355 Vistas
9 Respuestas
Respuestas (9)

maxim_k
Consultant
Consultant

Hi @ruirego ,

 

Do you mean DIVIDE command where you get points or blocks along an object (lines)?

How are these lines located relative to each other? Can you provide screenshot?

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Me gusta

maxim_k
Consultant
Consultant

If you need to divide LINEs from selection set of objects, try to use something like this:

 

(defun c:Multidivide ( / oldcmd ss1 num)
(setq oldcmd (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(defun sstolist (ss / sscnt)
 (setq sscnt 0 
sslist nil)
 (repeat (sslength ss)
  (setq sslist (cons (ssname 
ss sscnt) sslist))
  (setq sscnt (1+ 
sscnt))
 )
 (princ)
)
(prompt "Select objects to divide: ")
(ssget)
(setq ss1 (ssget "P" '((0 . "LINE"))))
(sstolist ss1)
(setq num (getint "Enter the number of parts to divide: "))
(foreach n sslist (command "DIVIDE" n num))
(setvar "CMDECHO" oldcmd)
(princ)
)

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Me gusta

ruirego
Enthusiast
Enthusiast

hello, yes its the command DIV.  

 

a can make line by line, but it would be better if i could select several lines, and DIV all at the same time.

 

in the screenshot attached in pink there are several lines

 

R^2

 

0 Me gusta

maxim_k
Consultant
Consultant

@ruirego ,

 

Try THIS LISP.

 

It prompts to select objects, filters lines from the selection set, asks for a number of divisions and divide selected lines.

You may need to adjust point style to see the results.

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Me gusta

ruirego
Enthusiast
Enthusiast
here do i paste this code?
0 Me gusta

maxim_k
Consultant
Consultant

@ruirego wrote:
here do i paste this code?

No, download attached LSP and use APPLOAD command to load it to each drawing.

The command name is Multidivide

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community

ruirego
Enthusiast
Enthusiast
Hello Maxim, i'm in Autocad LT 2024 for Mac

can i do this LISP?

tks
0 Me gusta

maxim_k
Consultant
Consultant

@ruirego 

You asked about LISP and didn't mention that you use AutoCAD LT for Mac.
AutoLISP is not a feature of AutoCAD LT for Mac, unfortunately you cannot use AutoLISP in AutoCAD LT for Mac.

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Me gusta

ruirego
Enthusiast
Enthusiast
thanks Maxim!
0 Me gusta