Jump to content

problem achieving correct selection set


MJLM

Recommended Posts

Hello everybody.

 

I have a main line and my intent is to make my own one dimension array command by duplicating a, perpendicularly connected to the main, line. Let s suppose that this perpendicular line is connected at the start point of the main line. While the perpendicular line being duplicated along the path of the main line, I want to break the main line at every point the new duplicate touches the main. For that I m making a selection set to capture both lines (new & main) as follows:

 

(setq s (ssget "C" w w '((0 . "LINE"))))

 

where w is the start point of the new dupplicate.

However this is not working reliably. Sometimes it captures both lines, sometimes not, sometimes not for all instances and therefore no brake occurs.

 

Is there a way to make it work reliable? Any alternative on how to make the selection set?

 

Thank you in advance.

Link to comment
Share on other sites

Firstly , I think your using of ssget function to make a selection set would not work in other than world coordinates . still a guess.

 

Why don't you make a selection set of the new created lines by adding them to a new separate selection set ?

 

e.g .

 

(setq sd (ssadd))

(setq e (entmakex (list '(0 . "LINE") '(10 0. 0. 0.) '(11 1. 0. 0.))))

(ssadd e sd)

So you would have the new new add to the new selection set variable sd

Link to comment
Share on other sites

The point here is not to make a sel.set of the new lines. The point is to make a selection set on every new intersection of the main and perpendicular line only. In the picture above the "ssget "C" pt pt not selecting two lines" does not refer to the two duplicates shown rather the main and the new perpendicular line as pair. Then this process will check the next pair and next and so on...

I m currently checking if I could avoid the ssget "c" option all together and find an other approach on how to break the main line. Any ideas are welcome.

Link to comment
Share on other sites

Try to use the fence mode "_F" instead of the "_C" with the ssget function then if that succeeded , you can redraw the main line with every intersecting point after gathering the coordinates and sorting them according to shortest distance from one of the two sides of the main line to

get them in order .

 

This could be a long way to go through but I think this should be perfect .

Link to comment
Share on other sites

yes but what should be pt2? maybe (+ (car w) 0.01) (+ (cadr w) 0.01) (+ (caddr w) 0.01)? Increasing the distance from 'w' may select other lines behind.

 

All "C", "F" etc switches are very unreliable to me for selecting. But it you don't have end endpoint there and need to select the line, what do you do?

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