Jump to content

Recommended Posts

Posted

Is it possible to assign a variable to the number returned by a selection Window or Box?. If so how. Thanking in advance.

Aloy

Posted

That is simple but I don't want to post a sample unless I know more details about your aim of the code :)

Posted

Hi Tharvat,

I am attempting triangulation. The idea is to tie the numer of points within a box or window to a variable (not selection set). If the number is greater than 9 then do something.

I understand triangulation is still a hot topic in some quaters.

Regards,

Aloy

Posted

Hi Aloy .

 

First you wrote my name in a wrong way . :)

 

Second , I hope this is what you are after .

 

(if (and (setq ss (ssget ))
          (eq 9 (sslength ss))
)
(do something here ....)
(otherwise nil or a message to user ...)
)

Posted

Hi Tharwat, sorry about the mispelling. Hope it has not given any unpleasent meaning. I will try it tomarrow morning and let you know what exactly I did.

Regards,

Aloy

Posted

Tharwat, Where to put the selection window or box?.

Posted
Tharwat, Where to put the selection window or box?.

 

Huh ? :huh:

Posted

Hi Tharwat,

No worry, I will get it. Perhaps AfraLISP entities is the answer. Sometime I wonder whether this is the right forum to get any meaningful help.

Regards,

Aloy

Posted

Sometime I wonder whether this is the right forum to get any meaningful help.

 

:ouch: , that is just wrong.

 

What are you after?

 

1+

Posted

Dont re-invent the wheel triangulation routines are out there in Lisp etc.

Posted
Sometime I wonder whether this is the right forum to get any meaningful help.

 

The way a process works: input>process>output, so as you can see, the output is controlled by the input.

 

If you want meaningful help, provide meaningful input.

Posted

I think for the first time ever, I have looked for the "Like" button.

Posted

Thanks irneb,

Unfortunately the link by adesk does not give the answer I am looking for.

Let me put my question again in a different way: There are a large number of points in model space (theser can be couple of thousands). I want to use a selection window by lisp and tie up the number of points (only the number count) to a variable to be used later. If I give a window in response to (ssget) manually, a number will be returned and that cannot be tied to a variable as far as I can see. If I try (ssget "_W" '(0 0) '(30 20)) I will get , which is not what I want . To my mind Acad is not geared to process such an input. Am I correct?.

Posted

(sslength (ssget "_W" '(0 0) '(30 20)))

 

?

Posted
Thanks irneb,

Unfortunately the link by adesk does not give the answer I am looking for.

Let me put my question again in a different way: There are a large number of points in model space (theser can be couple of thousands). I want to use a selection window by lisp and tie up the number of points (only the number count) to a variable to be used later. If I give a window in response to (ssget) manually, a number will be returned and that cannot be tied to a variable as far as I can see. If I try (ssget "_W" '(0 0) '(30 20)) I will get , which is not what I want . To my mind Acad is not geared to process such an input. Am I correct?.

As Tharwat's code does (and pBe's line) the ssget returns a selection set collection of all the entities which re selected. To get the number of entities use sslength on that selection set.

 

Also, as pBe's shown - you can use a window selection and send the XY coordinates to ssget so you don't need to manually pick the window.

 

If your "box" is 3d you might want to try using selection filters. In that help there is a link to how filters work. You'd need to use some logical groupings to check the "points's" dxf code 10 to ensure they're inside a specific 3d cube. Otherwise you can step through the selection set one item at a time and extract only those which are inside the box - through lisp code. The former method would work quicker though.

Posted

Bigal,

Thanks for giving me a link earlier for triangulation, but they want $75 for each user in the office. I am on this journey as a hobby, though I have used codes written in lisp by myself for design of roads as far back as 1992. I stopped after three roads were designed and constructed I have started again just last year. Let me know which languages are used for implementation of TIN surfaces and alignments in Civil 3D. Is it not half string based modelling? .

Regards,

Aloy

Posted

pBe, yes it works, Many thanks.

Posted

SLW210,

I posted some codes on Delaunay triangulation done by someone else which works well and draw vectors, but when I changed the vectors to lines it did not work. Up to 40 people had downloaded the files but I did not get a single reply to date. When I did the above posting only Tharwat replied but that too did not give a satisfactory answer. That prompted me to say what is quoted by you. I now have got satisfactory replies and I am sorry if I have hurt anybody's feelings in this forum.

Regards,

Aloy

  • 2 weeks later...
Posted

No problem, just letting you know if you are getting non-useful responses, then your question is not clear. As you did, more explanation was needed.

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