AutoCAD for Mac Forum
Welcome to Autodesk’s AutoCAD for Mac Forums. Share your knowledge, ask questions, and explore popular AutoCAD for Mac topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Macro LSP do not work Autocad MAC

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
jmdclemente
489 Views, 5 Replies

Macro LSP do not work Autocad MAC

Hi.

 

I am trying to use some macros I have for Autocad MAC 2020. I have. Load then all without errors, but when I run the macros it doesn’t happens nothing. It do not give any error or message...

 

please can You help? I can send the macros to confirm it is all ok.

 

thank You.

5 REPLIES 5
Message 2 of 6
maxim_k
in reply to: jmdclemente

Hi @jmdclemente ,

 

AutoCAD for Mac doesn't support some of the AutoLISP functions available in PC version

Maybe AutoLISP routines you are trying to use have such functions, but it is impossible to say something definite without having at hand your LSP files.

Can you attach them here?

 


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
Message 3 of 6
jmdclemente
in reply to: maxim_k

Maxim thank You for Your help. Sorry for my delay, but I am with a -5 GMT. I will post them (2 macros) late afternoon.

 

Thank You again.

Message 4 of 6
jmdclemente
in reply to: jmdclemente

(DEFUN *error* (msg)
  (IF (OR (= msg "Function cancelled")
  (= msg "quit / exit abort")
      )
    (PRINC)
    (PRINC (STRCAT "\nError: " msg))
  )
)
 
;;;reset system variables
(SETVAR "CMDECHO" 0)
(SETQ users1 "")
(SETQ users2 "")
(SETQ users3 "")
(COMMAND "units" "2" "4" "1" "3" "0" "n")
(SETVAR "osnapcoord" 1)
 
;;; system variables build-up
(DEFUN get_imf (/ dict)
  (SETVAR
    "useri5"
    (COND ((SETQ dict (DICTSEARCH (NAMEDOBJDICT) "ACAD_IMAGE_VARS"))
   (CDR (ASSOC 70 dict))
  )
  (T 1)
    )
  )
)
 
(SETQ users1 (RTOS (GETVAR "USERR1") 2 8))
(SETQ users2 (STRCAT "@" users1 "<90"))
(SETQ users3 (STRCAT "@" users1 "<270"))
(DEFUN setstline (/ stline)
  (get_imf)
  (SETQ
    stline (STRCAT
     "S+A PISOS: ""$(RTOS,$(GETVAR,USERR1),2,0)"
     " - OSNAP: ""$(getvar,osmode)"
     " - LTS: ""$(getvar,ltscale)"
     " - PSLTS: ""$(getvar,psltscale)"
     " - IMF: ""$(getvar,useri5)"
     " - PJN: ""$(getvar,projectname)"
    )
  )
  (SETVAR "modemacro" stline)
)
(setstline)
(PRINC)
 
;;;Useful UNDO BACK function
 
(DEFUN c:ub () (COMMAND "undo" "back"))
 
;;; Check for story height
 
(DEFUN c:pisos (/ dist)
  (COMMAND "undo" "begin")
  (SETQ dist 0)
  (PRINC (STRCAT "\n[S+A PISOS] Distância actual entre pisos é "
users1
" unidades."
)
  )
  (SETQ dist (GETREAL "Qual a nova distância entre pisos? "))
  (IF dist
    (SETVAR "USERR1" dist)
  )
  (SETQ users1 (RTOS (GETVAR "USERR1") 2 8))
  (SETQ users2 (STRCAT "@" users1 "<90"))
  (SETQ users3 (STRCAT "@" users1 "<270"))
  (setstline)
  (PRINC)
  (PRINC (STRCAT "\n[S+A PISOS] A distância entre pisos é agora de "
users1
" unidades."
)
  )
  (PRINC)
  (COMMAND "undo" "end")
  (PRINC)
)
 
;;;if story-height equals 0, msapisos has never been loaded. Call routine "pisos"
 
(DEFUN c:imf ()
  (setstline)
  (c:tframes)
  (setstline)
  (PRINC)
)
 
 
(DEFUN-Q
  chkpisos
  ()
  (IF (= (GETVAR "USERR1") 0.0)
    (PROMPT
      "\n \n ****************** MENSAGEM DE S+A PISOS ****************** \n AVISO! S+A pisos está activo, mas nunca foi utilizado.\n Use o commando PISOS para definir a distância entre pisos."
    )
  )
  (IF (NOT (= (GETVAR "USERR1") 0.0))
    (PROMPT
      (STRCAT
"\n \n ****************** MENSAGEM DE S+A PISOS ****************** \n Distância entre pisos está definida para "
users1
" unidades\n Use o commando PISOS para definir outra distância entre pisos."
      )
    )
  )
)
 
(DEFUN c:up ()
  (COMMAND "undo" "begin")
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "w")
  (COMMAND "-pan" "0,0,0" users3)
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "p")
  (COMMAND "undo" "end")
)
(DEFUN c:up2 (/ tmp)
  (SETQ tmp (STRCAT "@" (RTOS (/ (ATOF users1) 2) 2 😎 "<270"))
  (COMMAND "undo" "begin")
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "w")
  (COMMAND "-pan" "0,0,0" tmp)
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "p")
  (COMMAND "undo" "end")
)
 
(DEFUN c:dn ()
  (COMMAND "undo" "begin")
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "w")
  (COMMAND "-pan" "0,0,0" users2)
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "p")
  (COMMAND "undo" "end")
)
 
(DEFUN c:dn2 (/ tmp)
  (SETQ tmp (STRCAT "@" (RTOS (/ (ATOF users1) 2) 2 😎 "<90"))
  (COMMAND "undo" "begin")
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "w")
  (COMMAND "-pan" "0,0,0" tmp)
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "p")
  (COMMAND "undo" "end")
)
 
(DEFUN c:su (/ numpisos desloc_y valor)
  (COMMAND "undo" "begin")
  (SETQ numpisos (GETINT "[Storey Up - Go how many floors up?] Quantos pisos para cima? "))
  (SETQ desloc_y (* numpisos (GETVAR "USERR1")))
  (SETQ valor (RTOS desloc_y 2 4))
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "w")
  (COMMAND "-pan" "0,0,0" (STRCAT "@" valor "<270"))
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "p")
  (COMMAND "undo" "end")
)
 
(DEFUN c:sd (/ numpisos desloc_y valor)
  (COMMAND "undo" "begin")
  (SETQ numpisos (GETINT "[Storey Down - Go how many floors down?] Quantos pisos para baixo? "))
  (SETQ desloc_y (* numpisos (GETVAR "USERR1")))
  (SETQ valor (RTOS desloc_y 2 4))
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "w")
  (COMMAND "-pan" "0,0,0" (STRCAT "@" valor "<90"))
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "p")
  (COMMAND "undo" "end")
)
 
(DEFUN c:cu (/ ss)
  (COMMAND "undo" "begin")
  (PRINC
    "[Copy Up - Select objects to copy one storey up...] Seleccione o que quer copiar para o piso acima...\n"
  )
  (SETQ ss (SSGET))
  (IF ss
    (PROGN (COMMAND "pickstyle" "1")
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "w")
   (COMMAND "copy" ss "" "0,0,0" users2)
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "p")
   (COMMAND "pickstyle" "1")
    )
  )
  (PRINC)
  (COMMAND "undo" "end")
)
 
(DEFUN c:cd (/ ss)
  (COMMAND "undo" "begin")
  (PRINC
    "[Copy Down - Select objects to copy one storey down...] Seleccione o que quer copiar o piso abaixo...\n"
  )
  (SETQ ss (SSGET))
  (IF ss
    (PROGN (COMMAND "pickstyle" "1")
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "w")
   (COMMAND "copy" ss "" "0,0,0" users3)
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "p")
   (COMMAND "pickstyle" "1")
    )
  )
  (PRINC)
  (COMMAND "undo" "end")
)
 
(DEFUN c:mu (/ ss)
  (COMMAND "undo" "begin")
  (PRINC
    "[Move Up - Select objects to move one storey up...] Seleccione o que quer mover para o piso acima...\n"
  )
  (SETQ ss (SSGET))
  (IF ss
    (PROGN (COMMAND "pickstyle" "1")
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "w")
   (COMMAND "move" ss "" "0,0,0" users2)
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "p")
   (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
(PRINC)
 
(DEFUN c:md (/ ss)
  (COMMAND "undo" "begin")
  (PRINC
    "[Move Down - Select objects to move one storey down...] Seleccione o que quer mover para o piso abaixo...\n"
  )
  (SETQ ss (SSGET))
  (IF ss
    (PROGN (COMMAND "pickstyle" "1")
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "w")
   (COMMAND "move" ss "" "0,0,0" users3)
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "p")
   (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
(PRINC)
 
(DEFUN c:mcu (/ numpisos contador ss desloc_y valor)
  (COMMAND "undo" "begin")
  (PRINC
    "[Multiple Copy Up - Select objects to copy up to each of the storeys...] Seleccione o quer copiar para cada um dos pisos acima...\n"
  )
  (SETQ ss (SSGET))
  (if ss
    (progn
      (SETQ numpisos
     (GETINT
       "[Type the number of storeys you want the objects to be copied.] Introduza o numero de pisos para os quais quer copiar os itens. "
     )
      )
      (SETQ contador numpisos)
      (COMMAND "pickstyle" "1")
      (WHILE (> contador 0)
(SETQ desloc_y (* contador (GETVAR "USERR1")))
(SETQ valor (RTOS desloc_y 2 4))
;;LCA - COMMENT: The UCS command has new options.
(COMMAND "ucs" "w")
(COMMAND "copy" ss "" "0,0,0" (STRCAT "@" valor "<90"))
;;LCA - COMMENT: The UCS command has new options.
(COMMAND "ucs" "p")
(SETQ contador (- contador 1))
      )
      (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
 
(DEFUN c:mcd (/ numpisos contador ss desloc_y valor)
  (COMMAND "undo" "begin")
  (PRINC
    "[Multiple Copy Down - Select objects to copy down to each of the storeys...] Seleccione o quer copiar para cada um dos pisos abaixo...\n"
  )
  (SETQ ss (SSGET))
  (if ss
    (progn
      (SETQ numpisos
     (GETINT
       "[Type the number of storeys you want the objects to be copied.] Introduza o numero de pisos para os quais quer copiar os itens.  "
     )
      )
      (SETQ contador numpisos)
      (COMMAND "pickstyle" "1")
      (WHILE (> contador 0)
(SETQ desloc_y (* contador (GETVAR "USERR1")))
(SETQ valor (RTOS desloc_y 2 4))
;;LCA - COMMENT: The UCS command has new options.
(COMMAND "ucs" "w")
(COMMAND "copy" ss "" "0,0,0" (STRCAT "@" valor "<270"))
;;LCA - COMMENT: The UCS command has new options.
(COMMAND "ucs" "p")
(SETQ contador (- contador 1))
      )
      (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
 
 
(DEFUN c:mun (/ numpisos ss desloc_y valor)
  (COMMAND "undo" "begin")
  (PRINC
    "[Move Up to storey N - Select objects to move up...] Seleccione objectos a mover para cima...\n"
  )
  (SETQ ss (SSGET))
  (if ss
    (progn
      (SETQ numpisos (GETINT "[Move to how many storeys up?] Mover quantos pisos para cima? "))
      (COMMAND "pickstyle" "1")
      (SETQ desloc_y (* numpisos (GETVAR "USERR1")))
      (SETQ valor (RTOS desloc_y 2 4))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "w")
      (COMMAND "move" ss "" "0,0,0" (STRCAT "@" valor "<90"))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "p")
      (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
 
(DEFUN c:mdn (/ numpisos ss desloc_y valor)
  (COMMAND "undo" "begin")
  (PRINC
    "[Move Down to storey N - Select objects to move down...] Seleccione objectos a mover para baixo...\n"
  )
  (SETQ ss (SSGET))
  (if ss
    (progn
      (SETQ numpisos (GETINT "[Move how many storeys down?] Mover quantos pisos para baixo? "))
      (COMMAND "pickstyle" "1")
      (SETQ desloc_y (* numpisos (GETVAR "USERR1")))
      (SETQ valor (RTOS desloc_y 2 4))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "w")
      (COMMAND "move" ss "" "0,0,0" (STRCAT "@" valor "<270"))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "p")
      (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
 
 
(DEFUN c:cun (/ numpisos ss desloc_y valor)
  (COMMAND "undo" "begin")
  (PRINC
    "[Copy Up to storey N - Select objects to copy up...] Seleccione objectos a copiar para cima...\n"
  )
  (SETQ ss (SSGET))
  (if ss
    (progn
      (SETQ numpisos (GETINT "[Copy how many storeys up?] Copiar quantos pisos para cima? "))
      (COMMAND "pickstyle" "1")
      (SETQ desloc_y (* numpisos (GETVAR "USERR1")))
      (SETQ valor (RTOS desloc_y 2 4))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "w")
      (COMMAND "copy" ss "" "0,0,0" (STRCAT "@" valor "<90"))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "p")
      (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
 
 
(DEFUN c:cdn (/ numpisos ss desloc_y valor)
  (COMMAND "undo" "begin")
  (PRINC
    "[Copy Down to storey N - Select objects to copy down...] Seleccione objrctos a copiar para baixo...\n"
  )
  (SETQ ss (SSGET))
  (if ss
    (progn
      (SETQ numpisos (GETINT "[Copy how many storeys down?] Quantos pisos para baixo? "))
      (COMMAND "pickstyle" "1")
      (SETQ desloc_y (* numpisos (GETVAR "USERR1")))
      (SETQ valor (RTOS desloc_y 2 4))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "w")
      (COMMAND "copy" ss "" "0,0,0" (STRCAT "@" valor "<270"))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "p")
      (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
 
 
(SETQ s::startup (APPEND s::startup chkpisos))
 
(PROMPT
  "\n ****************** S+A PISOS está carregado no Autocad ****************** \n"
)
(PRINC)
Message 5 of 6
jmdclemente
in reply to: jmdclemente

(DEFUN *error* (msg)
  (IF (OR (= msg "Function cancelled")
  (= msg "quit / exit abort")
      )
    (PRINC)
    (PRINC (STRCAT "\nError: " msg))
  )
)
 
;;;reset system variables
(SETVAR "CMDECHO" 0)
(SETQ users1 "")
(SETQ users2 "")
(SETQ users3 "")
(COMMAND "units" "2" "4" "1" "3" "0" "n")
(SETVAR "osnapcoord" 1)
 
;;; system variables build-up
(DEFUN get_imf (/ dict)
  (SETVAR
    "useri5"
    (COND ((SETQ dict (DICTSEARCH (NAMEDOBJDICT) "ACAD_IMAGE_VARS"))
   (CDR (ASSOC 70 dict))
  )
  (T 1)
    )
  )
)
 
(SETQ users1 (RTOS (GETVAR "USERR1") 2 8))
(SETQ users2 (STRCAT "@" users1 "<90"))
(SETQ users3 (STRCAT "@" users1 "<270"))
(DEFUN setstline (/ stline)
  (get_imf)
  (SETQ
    stline (STRCAT
     "S+A PISOS: ""$(RTOS,$(GETVAR,USERR1),2,0)"
     " - OSNAP: ""$(getvar,osmode)"
     " - LTS: ""$(getvar,ltscale)"
     " - PSLTS: ""$(getvar,psltscale)"
     " - IMF: ""$(getvar,useri5)"
     " - PJN: ""$(getvar,projectname)"
    )
  )
  (SETVAR "modemacro" stline)
)
(setstline)
(PRINC)
 
;;;Useful UNDO BACK function
 
(DEFUN c:ub () (COMMAND "undo" "back"))
 
;;; Check for story height
 
(DEFUN c:pisos (/ dist)
  (COMMAND "undo" "begin")
  (SETQ dist 0)
  (PRINC (STRCAT "\n[S+A PISOS] Distância actual entre pisos é "
users1
" unidades."
)
  )
  (SETQ dist (GETREAL "Qual a nova distância entre pisos? "))
  (IF dist
    (SETVAR "USERR1" dist)
  )
  (SETQ users1 (RTOS (GETVAR "USERR1") 2 8))
  (SETQ users2 (STRCAT "@" users1 "<90"))
  (SETQ users3 (STRCAT "@" users1 "<270"))
  (setstline)
  (PRINC)
  (PRINC (STRCAT "\n[S+A PISOS] A distância entre pisos é agora de "
users1
" unidades."
)
  )
  (PRINC)
  (COMMAND "undo" "end")
  (PRINC)
)
 
;;;if story-height equals 0, msapisos has never been loaded. Call routine "pisos"
 
(DEFUN c:imf ()
  (setstline)
  (c:tframes)
  (setstline)
  (PRINC)
)
 
 
(DEFUN-Q
  chkpisos
  ()
  (IF (= (GETVAR "USERR1") 0.0)
    (PROMPT
      "\n \n ****************** MENSAGEM DE S+A PISOS ****************** \n AVISO! S+A pisos está activo, mas nunca foi utilizado.\n Use o commando PISOS para definir a distância entre pisos."
    )
  )
  (IF (NOT (= (GETVAR "USERR1") 0.0))
    (PROMPT
      (STRCAT
"\n \n ****************** MENSAGEM DE S+A PISOS ****************** \n Distância entre pisos está definida para "
users1
" unidades\n Use o commando PISOS para definir outra distância entre pisos."
      )
    )
  )
)
 
(DEFUN c:up ()
  (COMMAND "undo" "begin")
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "w")
  (COMMAND "-pan" "0,0,0" users3)
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "p")
  (COMMAND "undo" "end")
)
(DEFUN c:up2 (/ tmp)
  (SETQ tmp (STRCAT "@" (RTOS (/ (ATOF users1) 2) 2 😎 "<270"))
  (COMMAND "undo" "begin")
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "w")
  (COMMAND "-pan" "0,0,0" tmp)
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "p")
  (COMMAND "undo" "end")
)
 
(DEFUN c:dn ()
  (COMMAND "undo" "begin")
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "w")
  (COMMAND "-pan" "0,0,0" users2)
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "p")
  (COMMAND "undo" "end")
)
 
(DEFUN c:dn2 (/ tmp)
  (SETQ tmp (STRCAT "@" (RTOS (/ (ATOF users1) 2) 2 😎 "<90"))
  (COMMAND "undo" "begin")
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "w")
  (COMMAND "-pan" "0,0,0" tmp)
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "p")
  (COMMAND "undo" "end")
)
 
(DEFUN c:su (/ numpisos desloc_y valor)
  (COMMAND "undo" "begin")
  (SETQ numpisos (GETINT "[Storey Up - Go how many floors up?] Quantos pisos para cima? "))
  (SETQ desloc_y (* numpisos (GETVAR "USERR1")))
  (SETQ valor (RTOS desloc_y 2 4))
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "w")
  (COMMAND "-pan" "0,0,0" (STRCAT "@" valor "<270"))
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "p")
  (COMMAND "undo" "end")
)
 
(DEFUN c:sd (/ numpisos desloc_y valor)
  (COMMAND "undo" "begin")
  (SETQ numpisos (GETINT "[Storey Down - Go how many floors down?] Quantos pisos para baixo? "))
  (SETQ desloc_y (* numpisos (GETVAR "USERR1")))
  (SETQ valor (RTOS desloc_y 2 4))
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "w")
  (COMMAND "-pan" "0,0,0" (STRCAT "@" valor "<90"))
  ;;LCA - COMMENT: The UCS command has new options.
  (COMMAND "ucs" "p")
  (COMMAND "undo" "end")
)
 
(DEFUN c:cu (/ ss)
  (COMMAND "undo" "begin")
  (PRINC
    "[Copy Up - Select objects to copy one storey up...] Seleccione o que quer copiar para o piso acima...\n"
  )
  (SETQ ss (SSGET))
  (IF ss
    (PROGN (COMMAND "pickstyle" "1")
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "w")
   (COMMAND "copy" ss "" "0,0,0" users2)
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "p")
   (COMMAND "pickstyle" "1")
    )
  )
  (PRINC)
  (COMMAND "undo" "end")
)
 
(DEFUN c:cd (/ ss)
  (COMMAND "undo" "begin")
  (PRINC
    "[Copy Down - Select objects to copy one storey down...] Seleccione o que quer copiar o piso abaixo...\n"
  )
  (SETQ ss (SSGET))
  (IF ss
    (PROGN (COMMAND "pickstyle" "1")
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "w")
   (COMMAND "copy" ss "" "0,0,0" users3)
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "p")
   (COMMAND "pickstyle" "1")
    )
  )
  (PRINC)
  (COMMAND "undo" "end")
)
 
(DEFUN c:mu (/ ss)
  (COMMAND "undo" "begin")
  (PRINC
    "[Move Up - Select objects to move one storey up...] Seleccione o que quer mover para o piso acima...\n"
  )
  (SETQ ss (SSGET))
  (IF ss
    (PROGN (COMMAND "pickstyle" "1")
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "w")
   (COMMAND "move" ss "" "0,0,0" users2)
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "p")
   (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
(PRINC)
 
(DEFUN c:md (/ ss)
  (COMMAND "undo" "begin")
  (PRINC
    "[Move Down - Select objects to move one storey down...] Seleccione o que quer mover para o piso abaixo...\n"
  )
  (SETQ ss (SSGET))
  (IF ss
    (PROGN (COMMAND "pickstyle" "1")
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "w")
   (COMMAND "move" ss "" "0,0,0" users3)
   ;;LCA - COMMENT: The UCS command has new options.
   (COMMAND "ucs" "p")
   (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
(PRINC)
 
(DEFUN c:mcu (/ numpisos contador ss desloc_y valor)
  (COMMAND "undo" "begin")
  (PRINC
    "[Multiple Copy Up - Select objects to copy up to each of the storeys...] Seleccione o quer copiar para cada um dos pisos acima...\n"
  )
  (SETQ ss (SSGET))
  (if ss
    (progn
      (SETQ numpisos
     (GETINT
       "[Type the number of storeys you want the objects to be copied.] Introduza o numero de pisos para os quais quer copiar os itens. "
     )
      )
      (SETQ contador numpisos)
      (COMMAND "pickstyle" "1")
      (WHILE (> contador 0)
(SETQ desloc_y (* contador (GETVAR "USERR1")))
(SETQ valor (RTOS desloc_y 2 4))
;;LCA - COMMENT: The UCS command has new options.
(COMMAND "ucs" "w")
(COMMAND "copy" ss "" "0,0,0" (STRCAT "@" valor "<90"))
;;LCA - COMMENT: The UCS command has new options.
(COMMAND "ucs" "p")
(SETQ contador (- contador 1))
      )
      (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
 
(DEFUN c:mcd (/ numpisos contador ss desloc_y valor)
  (COMMAND "undo" "begin")
  (PRINC
    "[Multiple Copy Down - Select objects to copy down to each of the storeys...] Seleccione o quer copiar para cada um dos pisos abaixo...\n"
  )
  (SETQ ss (SSGET))
  (if ss
    (progn
      (SETQ numpisos
     (GETINT
       "[Type the number of storeys you want the objects to be copied.] Introduza o numero de pisos para os quais quer copiar os itens.  "
     )
      )
      (SETQ contador numpisos)
      (COMMAND "pickstyle" "1")
      (WHILE (> contador 0)
(SETQ desloc_y (* contador (GETVAR "USERR1")))
(SETQ valor (RTOS desloc_y 2 4))
;;LCA - COMMENT: The UCS command has new options.
(COMMAND "ucs" "w")
(COMMAND "copy" ss "" "0,0,0" (STRCAT "@" valor "<270"))
;;LCA - COMMENT: The UCS command has new options.
(COMMAND "ucs" "p")
(SETQ contador (- contador 1))
      )
      (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
 
 
(DEFUN c:mun (/ numpisos ss desloc_y valor)
  (COMMAND "undo" "begin")
  (PRINC
    "[Move Up to storey N - Select objects to move up...] Seleccione objectos a mover para cima...\n"
  )
  (SETQ ss (SSGET))
  (if ss
    (progn
      (SETQ numpisos (GETINT "[Move to how many storeys up?] Mover quantos pisos para cima? "))
      (COMMAND "pickstyle" "1")
      (SETQ desloc_y (* numpisos (GETVAR "USERR1")))
      (SETQ valor (RTOS desloc_y 2 4))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "w")
      (COMMAND "move" ss "" "0,0,0" (STRCAT "@" valor "<90"))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "p")
      (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
 
(DEFUN c:mdn (/ numpisos ss desloc_y valor)
  (COMMAND "undo" "begin")
  (PRINC
    "[Move Down to storey N - Select objects to move down...] Seleccione objectos a mover para baixo...\n"
  )
  (SETQ ss (SSGET))
  (if ss
    (progn
      (SETQ numpisos (GETINT "[Move how many storeys down?] Mover quantos pisos para baixo? "))
      (COMMAND "pickstyle" "1")
      (SETQ desloc_y (* numpisos (GETVAR "USERR1")))
      (SETQ valor (RTOS desloc_y 2 4))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "w")
      (COMMAND "move" ss "" "0,0,0" (STRCAT "@" valor "<270"))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "p")
      (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
 
 
(DEFUN c:cun (/ numpisos ss desloc_y valor)
  (COMMAND "undo" "begin")
  (PRINC
    "[Copy Up to storey N - Select objects to copy up...] Seleccione objectos a copiar para cima...\n"
  )
  (SETQ ss (SSGET))
  (if ss
    (progn
      (SETQ numpisos (GETINT "[Copy how many storeys up?] Copiar quantos pisos para cima? "))
      (COMMAND "pickstyle" "1")
      (SETQ desloc_y (* numpisos (GETVAR "USERR1")))
      (SETQ valor (RTOS desloc_y 2 4))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "w")
      (COMMAND "copy" ss "" "0,0,0" (STRCAT "@" valor "<90"))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "p")
      (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
 
 
(DEFUN c:cdn (/ numpisos ss desloc_y valor)
  (COMMAND "undo" "begin")
  (PRINC
    "[Copy Down to storey N - Select objects to copy down...] Seleccione objrctos a copiar para baixo...\n"
  )
  (SETQ ss (SSGET))
  (if ss
    (progn
      (SETQ numpisos (GETINT "[Copy how many storeys down?] Quantos pisos para baixo? "))
      (COMMAND "pickstyle" "1")
      (SETQ desloc_y (* numpisos (GETVAR "USERR1")))
      (SETQ valor (RTOS desloc_y 2 4))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "w")
      (COMMAND "copy" ss "" "0,0,0" (STRCAT "@" valor "<270"))
      ;;LCA - COMMENT: The UCS command has new options.
      (COMMAND "ucs" "p")
      (COMMAND "pickstyle" "1")
    )
  )
  (COMMAND "undo" "end")
)
 
 
(SETQ s::startup (APPEND s::startup chkpisos))
 
(PROMPT
  "\n ****************** S+A PISOS está carregado no Autocad ****************** \n"
)
(PRINC)
Message 6 of 6
maxim_k
in reply to: jmdclemente

Hi @jmdclemente ,

 

I looked at your msa_pisos.lsp file.

The problem is that it uses a custom function (setstline):

(DEFUN setstline (/ stline)
  (get_imf)
  (SETQ
    stline (STRCAT
	     "S+A PISOS: "		"$(RTOS,$(GETVAR,USERR1),2,0)"
	     " - OSNAP: "		"$(getvar,osmode)"
	     " - LTS: "		"$(getvar,ltscale)"
	     " - PSLTS: "		"$(getvar,psltscale)"
	     " - IMF: "		"$(getvar,useri5)"
	     " - PJN: "		"$(getvar,projectname)"
	    )
  )
  (SETVAR "modemacro" stline)
)

that changes the MODEMACRO system variable, but this variable is not supported in AutoCAD for Mac.

When I commented this function in your LSP, it started loading and working, as it seems to me, fine.

 

Try attached LSP.

 

BTW, if you want to place AutoLISP code in your post, please use "Insert/Edit code sample" button instead of pasting code directly to the post:

2021-06-05_21-01-08.png

 


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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report