Jump to content

problem with ascending arrangement of a list


سبع الليل

Recommended Posts

بسم الليه الرحمن الرحيم

الحمد لله رب العالمين ، و الصلاة و السلام على أشرف المرسلين ، أشهد أن لا إله إلا الله ، و أن محمداً رسول الله ، و أن عيسى المسيح عبد الله و رسوله و كلمته ألقاها إلى مريم ،، و بعد :

 

Hii Guys and cad msters :

I hope your help to do something that i tried many times and searched alot but failed

i think it is easy , but i dont know how

my question is :

i have that list

(setq A (list 2 9 7 12 3 4 8 ))

i need a list "b" is the arrangement of list "A" asscending (from smallest to largest "

How ???

 

and also ::

I have that recatangle point list (list (5 1 ) ( 0 1) ( 0 3 ) (5 3))

I need to arrange it from the smallest x-coordinate to the largest one ,,, I.E

(list ( 0 1) (5 1 ) (5 3) ( 0 3 ) )

How ???

 

 

Thank you ,,, and i love you

Link to comment
Share on other sites

For sorting please check the VL-SORT function:

(vl-load-com)
(setq A (list 2 9 7 12 3 4 8 ))
(setq B (vl-sort A '<))

 

Regarding the second sorting, seems that you are looking to parse the corners in clock-wise sense, not to sort them ascending by X coordinate.

Link to comment
Share on other sites

Thank you alot Mr Msasu ,, I love you

جزاك الله خيراً مهندس ثروت

مش حضرتك مهندس ثروت 313 في ملتقى المهندسيتن العرب ؟؟

منتدى الأوتوكاد منور بحضرتك و الله

Link to comment
Share on other sites

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...