Jump to content

Recommended Posts

Posted

Hi All,

 

how can I say this in autolisp:

 

(if (= a b) then do these (xxx) (xx) (xxxx)

)

 

I want to do several things after having a=b.

I wrote:

(if (= a b) ((xxx) (xx) (xxxx))

)

but for some reasons doesn't work!

 

can you please help me with this?

 

Cheers

 

Ali

Posted

got it!

 

(progn (xxx) (xx) (xxxx))

Posted

Progn is your new friend.

The (if (A) (B) ©) means: if A is true then do B else do C.

to do more "things" use the (progn...) command.

(if (A) (progn B1 B2 B3) (progn C1 C2...))

This structure can be translated as: If A is true then do B1, after that do B2, B3; If A is not true then do C1, c2,...

Posted

You found it out by yourself. This knowledge is more valuable.

Posted
You found it out by yourself. This knowledge is more valuable.

 

Thanks mate,

 

As always explained it very nice.

 

Yes, I found it by searching the help. As I used to programming in Basic when I was at high-school I am familiar a little bit with programming so I was guessing something like that should be exist.

 

autoLISP is fantastic!!!

 

I am new and just started a week ago but found it incredible.

 

Thanks All for your support

 

Ali

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...