LISP error

LISP error

IkaroFalcao
Enthusiast Enthusiast
713 Views
3 Replies
Message 1 of 4

LISP error

IkaroFalcao
Enthusiast
Enthusiast

Hey Guys, whats up?

Well I am developing a lisp to automatically create a list of the blocks that I have in the drawing, so the client know its meaning.
Everything was workking just fine but suddenly a problem happened, the lisp is inserting two different blocks in the same insert point.

As the picture:

Untitled1.png

But that is how it should look(and was looking):

Untitled1.png

 

Here is the code that I developed:

 

Untitled1.png

 

Thank you in andvance.

0 Likes
Accepted solutions (2)
714 Views
3 Replies
Replies (3)
Message 2 of 4

ВeekeeCZ
Consultant
Consultant
Accepted solution

Must say it's very practical way how to share the code. Personally I would prefer if you post it as a text.
Anyway, it looks like you are not turning the osnap off. Use "_none" in front of each point inside of (command) function.

(command "_.insert" pathname "_none" pt ....)
0 Likes
Message 3 of 4

hmsilva
Mentor
Mentor
Accepted solution

Hi Ikaro,

in addition to BeeKee's advices, use the "_NON" in the insert command and next time please post your code as text....It will be much easier to provide some help, I would suggest also to test the return from 'getpoint' before using it as an argumente for the next functions, and the no need to repeat the same bit of code numerous times...

 

Untested...

 

 ; test a returned valid point from user input
(if (setq ponto1 (getpoint "\nInforme onde inserir a legenda... "))
   (progn
      (setq insercao 0
            dist     0.5
            lst      '("Quadro de Luz e ou Tomadas" "Quadro de Força" "Quadro Distribuição Lógica ou Interfone" "e todos os outros blocos...")
      )
      (command "_.insert" "C:/PJ/Legenda/Titulo(legenda).dwg" "_S" 1 "_R" 0 "_NON" ponto1)
      (foreach blk lst
         (if (tblsearch "BLOCK" blk)
            (progn
               (setq insercao (1+ insercao)
                     ponto2   (polar ponto1 (* 1.5 pi) (* dist insercao))
               )
               (command "_.insert" (strcat "C:/PJ/Legenda/" blk "(legenda)") "_S" 1 "_R" 0 "_NON" ponto2)
            )
         )
      )
   )
)

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 4 of 4

IkaroFalcao
Enthusiast
Enthusiast

Thank you guys, that was the problem.

 

Next time I will put the code as text, sorry about that.

0 Likes