Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

stuck with Boundary command

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
thavasi1982
520 Views, 7 Replies

stuck with Boundary command

 

Dear All,

I need to check whether a boundary can be created or not. I have write the following conventional code and it returns the error.

 

(if (not (vl-cmdf "-boundary" "a" "O" "P" "" P1 ""))    

              (setq adj-panel-list (list "")) 

              (setq adj-panel-list nil)

);if

 

Is there any way to use the boundary command?

 

Thanks

STM

7 REPLIES 7
Message 2 of 8
hmsilva
in reply to: thavasi1982

Something like this perhaps

(setq lstobj (entlast))
(vl-cmdf "-boundary" "a" "O" "P" "" P1 "")
(if (not (eq lstobj (entlast)))
  (prompt "\nThe boundary was created!")
  (prompt "\nThe boundary was not created!")
)

HTH

Henrique

EESignature

Message 3 of 8
_Tharwat
in reply to: thavasi1982

Something like this should work .

 

(setq e    (entlast)
      done nil
)
(vl-cmdf "-boundary" "a" "O" "P" "" P1 "")
(if (and (/= (setq x (entlast)) e) (wcmatch (cdr (assoc 0 (entget x))) "*POLYLINE"))
  (setq done T)
  (setq done nil)
)

 

Message 4 of 8
hmsilva
in reply to: _Tharwat


@_Tharwat wrote:

Something like this should work .

 

(setq e    (entlast)
      done nil
)
(vl-cmdf "-boundary" "a" "O" "P" "" P1 "")
(if (and (/= (setq x (entlast)) e) (wcmatch (cdr (assoc 0 (entget x))) "*POLYLINE"))
  (setq done T)
  (setq done nil)
)

 


Hi Tharwat,

are you sure that the return from (/= (setq x (entlast)) e) is the correct one?

It will return always T, and (= (setq x (entlast)) e) It will return always nil... Perhaps something like (not (eq (setq x (entlast)) e))...

 

Cheers

Henrique

EESignature

Message 5 of 8
_Tharwat
in reply to: hmsilva


@hmsilva wrote:

Hi Tharwat,

are you sure that the return from (/= (setq x (entlast)) e) is the correct one?

It will return always T, and (= (setq x (entlast)) e) It will return always nil... Perhaps something like (not (eq (setq x (entlast)) e))...

 

Cheers

Henrique


You're right henrique . Smiley Happy

 

I guess yesterday or before yesterday I faced the same issue and was shocked with the wrong return of the operator /= and leave it without being convinced how could that be , but now you did clarify it very well .

 

Thank you .

Message 6 of 8
hmsilva
in reply to: _Tharwat


@_Tharwat wrote:

...  I faced the same issue and was shocked with the wrong return of the operator /= ...


Have been there before... 🙂

 

Cheers

Henrique


EESignature

Message 7 of 8
thavasi1982
in reply to: hmsilva

Thanks a lot "hmsilva" & "Tharwat"

 

STM

Message 8 of 8
hmsilva
in reply to: thavasi1982

You're welcome, thavasi
Glad I could help

Henrique

EESignature

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

Post to forums  

Autodesk Design & Make Report

”Boost