Jump to content

Recommended Posts

Posted

Dear Community,

Really nice to meet you all. I'm reaching out to you through this medium because I need assistance with AutoLISP files for AutoCAD and the MacOS Sonoma operating system.

 

Let me explain in detail:

 

- I've found the breakall.lsp file online, which allows cutting lines at each intersection point. This file is supported for AutoCAD on Windows, but I would like you to modify the script so that it can function on Mac. Currently, I work with AutoCAD 2019, but I would like the files to work on other versions as well.

 

- Additionally, I would need to build an AutoLISP from scratch that can be compatible with both MacOS and Windows. The AutoLISP would need to execute the following:

1 - Starting with a .dwg file with multiple layers

2 - Exporting different files to .dxf, one file for each layer.

3 - Naming each new file as: "YYMMDD_FileName_LayerName"

 

I understand that the first consultation is more viable, but I would like to know your opinion.

 

Thanks in advance!😀

breakall.lsp

Posted

I use "break all" no problems the issue is that the MAC version is missing some of the enhanced lisp functions, somewhere there is some details about this. It will be a VL function not working. Would need to know about MAC limitations so could at least identify which function not working.

 

As a first I would add this (princ "\nFunction XYZ") after each (defun line where XYZ is function name you should get a lot of "function" in the text screen hopefully the last one is the one it crashes on. There are 15 defuns. That may give us a clue.

Posted

AutoLISP on the MacOS cannot use any Visual LISP (i.e. vl, vla, vlax, vlr) functions. CAB's breakall relies heavily on Visual LISP so I would say - sorry!

While it may be possible to re-write this to remove all the visual LISP calls (and I am not sure of that). It is not a project I am willing to take on.

Posted (edited)
On 4/11/2024 at 8:43 PM, BIGAL said:

I use "break all" no problems the issue is that the MAC version is missing some of the enhanced lisp functions, somewhere there is some details about this. It will be a VL function not working. Would need to know about MAC limitations so could at least identify which function not working.

 

As a first I would add this (princ "\nFunction XYZ") after each (defun line where XYZ is function name you should get a lot of "function" in the text screen hopefully the last one is the one it crashes on. There are 15 defuns. That may give us a clue.

Dear all, 

thanks for your help! @pkenewell just one doubt. I'm quite sure that I will need only the command Breakall.

 

In this sense this is the script:

 

;;==========================================
;;        Break all objects selected        
;;==========================================
(defun c:breakall (/ cmd ss)

  (command "._undo" "_begin")
  (setq cmd (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)

  ;;  get objects to break
  (prompt "\nSelect All objects to break & press enter: ")
  (if (setq ss (ssget '((0 . "LINE,ARC,SPLINE,LWPOLYLINE,POLYLINE,CIRCLE,ELLIPSE"))))
     (Break_with ss ss nil) ; ss2break ss2breakwith (flag nil = not to break with self)
  )

  (setvar "CMDECHO" cmd)
  (command "._undo" "_end")
  (princ)
)

 

How did you suggest to modify it?

 

image.png

Edited by SLW210
Added Code Tags!
Posted

Please use Code Tags in the future. (<> in the editor toolbar)

  • Like 1
Posted (edited)
1 hour ago, Matteo Ferrari said:

Dear all, 

thanks for your help! @pkenewell just one doubt. I'm quite sure that I will need only the command Breakall.

 

In this sense this is the script:

 

@Matteo Ferrari The code you posted references a function called (break_with), and will not run without that function. This function contains many Visual LISP functions that won't run in the MacOS.

 

Have you tried contacting the Author Charles Alan Butler? @CAB

Edited by pkenewell
Posted

Not to discourage anyone, but all of the various LISPs for Breaking Objects at intersections or similar and LISPs to create new dxfs from layers all seem to use VLISP to the best of my knowledge. I am sure there is a valid reason for that.

 

I would just forgo using a MAC unless it was setup to use AutoCAD for Windows. IMHO

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