Programação Lisp "BricsCAD x AutoCAD"

Good morning everyone
I've just migrated from autoCAD to Brics, and I liked the similarity, but I'm having some difficulty with some routines because it works in autoCAD but in Brics there is an error.
as not described below:

; [2].......MOSTRAR-ALL-IT <<--
;
; ----- Error around expression -----
; (LET NIL (GETINT "
.... PAUSE") (IF (OR #INDST_PARCL) (PROGN (PRINC "

but this happens in several functions "(defun"

I'm kind of lost ... I do not know how to solunate, apparently everything is correct.
I carry the same routine in AutoCAD and it works perfectly

I'm Brazilian and I speak Portuguese, I'm using Translator, maybe some words out of context but out of context ....

Below is the Lsip routine:


(defun #Mostrar_SetorEGrupo ()
(GETINT "\n..... ") ;;;; only to pause at this point
(IF (/= #Indst_ParcL nil)(PROGN (PRINC "\nSetor: ")(princ #Indst_ParcL )))
(IF (/= #Grupo_Escol nil)(PROGN (PRINC "|Grupo: ")(princ #Grupo_Escol )))
)


I'm waiting, thank you.

Comments

  • Kerry Brown
    edited May 2019

    Hi LaudReis
    Does this Help ?

    ;; (#Mostrar_SetorEGrupo)
    
    (defun #Mostrar_SetorEGrupo ()
      (setq #Indst_ParcL (getint "\nInput Integer : "))  ;;;; only to pause at this point
      (setq #Grupo_Escol (* #Indst_ParcL 2)) 
      (if (/= #Indst_ParcL nil)
        (progn
          (princ "\nSetor: ") 
          (princ #Indst_ParcL)      
        )
      )
      (if (/= #Grupo_Escol nil)
        (progn
          (princ "|Grupo: ")       
          (princ #Grupo_Escol)
        )
      )
      (princ)
    )
    

    DoIt: BLADE
    DoIt: #MOSTRAR_SETOREGRUPO
    DoIt: (#Mostrar_SetorEGrupo)
    Input Integer : 21

    Setor: 21|Grupo: 42

  • Thanks Kerry Brown
    But I did some testing on here.
    to check the results, and I came across the following.

    when I tested the routine separately before using my "Key / Head" program it works correctly.

    But when I'm using my commando (IT) that loads the routine
    (Mostrar_SetorEGrupo) it shows the error in this function, ie "there is no error in the function", but something structural or variaves or something of the type.

    So I post a question, I'm new to BricsCAD but I've been programming in AutoLISP for a long time:
    You remember when they migrated to BricsCAD something similar happened, that is, to make errors in routines (defun's) that in AutoCAD worked. (but again I have tested (Mostrar_SetorEGrupo) separately and it works in BricsCAD.

    As I said it may be something in the structure of my program or in the variaves or something of the type.
    If anyone can help me. I already watered in advance

  • Roy Klein Gebbinck
    edited May 2019

    I notice the error message in the OP mentions a 'let' function. Be advised that BricsCAD has a built-in let function whereas AFAIK AutoCAD does not. Try renaming your custom let function.

  • Kerry Brown
    edited May 2019

    @Roy Klein Gebbinck said:
    the OP mentions a 'let' function. Be advised that BricsCAD has a built-in let function

    Whoa .. when did that happen .. I'll take it off my wish list.

    Do you have a link to docs or spec' ??

    Regards,

    added:
    The usage of the OR is unusual.
    and:
    (if (/= #Indst_ParcL nil) ...
    could be
    (if (not (boundp #Indst_ParcL)) ...

  • This let function is part of the underlying Lisp engine. It may be unwise to use it considering it is indeed undocumented.

    Example:
    (let ((a 3) (b 5)) (* a b))

  • Thanks Roy,
    May be time to talk to Torsten :)