Erro no "ssegt"

Erro no "ssegt"

humbertoha_sae
Explorer Explorer
1,008 Views
10 Replies
Message 1 of 11

Erro no "ssegt"

humbertoha_sae
Explorer
Explorer

(setq ss (ssget "X" '((0 . "LINHA") (-3 ("codigo")))))
; erro: sequência de caracteres de modo ssget incorreta

 

(setq ss (ssget "X" '((0 . "LINE") (-3 ("codigo")))))
; erro: sequência de caracteres de modo ssget incorreta

 

Onde, "codigo" é o nome da "aplicação" registrada na entidade.

 

Qual a causa do erro?

 

Estou usando o AutoCAD Map 2023

0 Likes
Accepted solutions (1)
1,009 Views
10 Replies
Replies (10)
Message 2 of 11

paullimapa
Mentor
Mentor

to retrieve reg apps, you'll have to follow this format:

AutoCAD 2016 Help: About Retrieving Extended Data (AutoLISP) (autodesk.com)


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 11

john.uhden
Mentor
Mentor

@humbertoha_sae 

Perhaps the app is not registered or it's spelled differently.

To check if an app is registered, use this:

(defun @regapp? (appname)
  (if (tblsearch "appid" appname)
    (alert (strcat appname " is registered."))
    (alert (strcat appname " is NOT registered."))
  )
)

John F. Uhden

0 Likes
Message 4 of 11

humbertoha_sae
Explorer
Explorer
O curioso é que o "código lisp" não identifica a "app",
no entanto o comando "xdlist" identifica!?!?

[image: image.png]
0 Likes
Message 5 of 11

john.uhden
Mentor
Mentor

@humbertoha_sae 

Lo siento.  No entiendo Hispaniol.

John F. Uhden

0 Likes
Message 6 of 11

hmsilva
Mentor
Mentor

@humbertoha_sae wrote:

(setq ss (ssget "X" '((0 . "LINHA") (-3 ("codigo")))))
; erro: sequência de caracteres de modo ssget incorreta

 

(setq ss (ssget "X" '((0 . "LINE") (-3 ("codigo")))))
; erro: sequência de caracteres de modo ssget incorreta

 

Onde, "codigo" é o nome da "aplicação" registrada na entidade.

 

Qual a causa do erro?

 

Estou usando o AutoCAD Map 2023


Olá @humbertoha_sae 

(setq ss (ssget "X" '((0 . "LINE") (-3 ("codigo")))))

deverá funcionar como pretendido (should work as expected)

Para ajuda em Português...

 

Hope this helps,
Henrique

EESignature

Message 7 of 11

john.uhden
Mentor
Mentor

@hmsilva 

Bravo!

Why didn't I catch that?

John F. Uhden

Message 8 of 11

humbertoha_sae
Explorer
Explorer
Já havia tentado.
Mudei para "LINHA" na tentativa de resolver.
0 Likes
Message 9 of 11

hmsilva
Mentor
Mentor

@humbertoha_sae wrote:

(setq ss (ssget "X" '((0 . "LINHA") (-3 ("codigo")))))
; erro: sequência de caracteres de modo ssget incorreta

 

(setq ss (ssget "X" '((0 . "LINE") (-3 ("codigo")))))
; erro: sequência de caracteres de modo ssget incorreta

 

Onde, "codigo" é o nome da "aplicação" registrada na entidade.

 

Qual a causa do erro?

 

Estou usando o AutoCAD Map 2023


@humbertoha_sae 

 

(setq ss (ssget "X" '((0 . "LINHA") (-3 ("codigo")))))
;; or
(setq ss (ssget "X" '((0 . "LINE") (-3 ("codigo")))))

 

should not generate an error (não deveriam gerar erro)

the first will always return nil  because the entity LINHA does not exist (o primeiro retorna sempre nil porque  a entidade LINHA não existe)

The second returns nil if there are no elements with XDATA or if there is no RegApp with that name (a segunda retorna nil se não existirem elementos com XDATA ou se não existir a RegApp com esse nome),  if there are LINES with XDATA associated with the RegApp with that name it returns a selection set (caso existam LINES with XDATA associada à RegApp comesse nome retorna uma seleção).

Attach an example drawing, with some lines with XDATA, it will be easier for someone to help you (Anexa um desenho de exemplo, com algumas linhas com XDATA, que será mais facil alguem poder te ajudar)

 

This forum is in English, if you need help in Portuguese, post in this forum AutoCAD - Português (Este forum é em Inglês, se necessitares de ajuda em Português, passa a postar neste forum AutoCAD - Português)

 

Hope this helps,
Henrique

EESignature

Message 10 of 11

humbertoha_sae
Explorer
Explorer
Accepted solution
(setq ss (ssget "_X" '((0 . "LINHA") (-3 ("codigo")))))

The solution was to put an underscore before the "x"

0 Likes
Message 11 of 11

hmsilva
Mentor
Mentor

@humbertoha_sae wrote:
(setq ss (ssget "_X" '((0 . "LINHA") (-3 ("codigo")))))

The solution was to put an underscore before the "x"


Glad you got a solution!


I didn't notice that you were using a non-English versions of AutoCAD.
The underscore ensures the English version is used in a non-English AutoCAD version.

 

Henrique

EESignature

0 Likes