Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Mentor
alanjt_
Posts: 469
Registered: ‎08-25-2008
Message 31 of 36 (137 Views)

Re: want to select several objects and get srating and endpoint of each one

05-15-2013 02:05 PM in reply to: cadking2k5

cadking2k5 wrote:

highlighted means the one you select when you select objects they become highlighted isn't that what (redraw eName 3) dose


Correct.

*Expert Elite*
Kent1Cooper
Posts: 5,242
Registered: ‎09-13-2004
Message 32 of 36 (135 Views)

Re: want to select several objects and get srating and endpoint of each one

05-15-2013 02:17 PM in reply to: cadking2k5

cadking2k5 wrote:

... trim and extend will not do what I am trying to do it will only trim or exten if it crosses the line I am going to make it extend or time to that axis ....


[I assume the word 'time' above is meant to be 'trim'.]  Another possibility in those two commands that you may not be aware of is the Edge option, which can be set to Extend or No Extend.  If it is set to Extend, things to not need to cross, but will extend or trim to the extension of the selected boundary, or the virtual intersection, which I think will solve the issue quoted above.  You can do it inside either command by choosing that option, or you can set the EDGEMODE System Variable to 1 before you start.

Kent Cooper
*Expert Elite*
Kent1Cooper
Posts: 5,242
Registered: ‎09-13-2004
Message 33 of 36 (130 Views)

Re: want to select several objects and get srating and endpoint of each one

05-15-2013 02:39 PM in reply to: cadking2k5

cadking2k5 wrote:

highlighted means the one you select when you select objects they become highlighted isn't that what (redraw eName 3) dose


If that's the issue, and, as some messages suggest, more than the last-selected item should be highlighted, it looks like the code in message 13 is doing something like that [as are later suggestions], but then doing nothing with the resulting list, nor with any of the Lines in it except to highlight them, so I'm not sure what the point of the highlighting is.  Should the (foreach) function that begins the second part be using that eNames list instead of the mysterious '(r), to extend or trim things to the whole set of first-part Lines?  But then it would be asking for selection of things to extend/trim in relation to individual Lines in the eNames list, in which case wouldn't you want only that one that's currently pertinent highlighted?  Or, if they want things extended or trimmed to that whole collection, shouldn't the things be put into a selection set rather than into a list, to feed to the object-selection prompt in the Extend or Trim command?  No, I guess not, because I don't think there would be a way to decide whether to extend or trim a given second-part object.  But then the code in Message 16 [and 18] asks the User to select an individual object as a boundary.  It's not highlighted, but it could be easily enough, but other messages sound like that's not what's wanted, since I think it would be only the one Line.  I'm still confused....

Kent Cooper
Valued Contributor
cadking2k5
Posts: 71
Registered: ‎04-17-2012
Message 34 of 36 (123 Views)

Re: want to select several objects and get srating and endpoint of each one

05-15-2013 03:11 PM in reply to: Kent1Cooper

forget everything and start over I am trying to make it so I can select several lines at once and get each end point asigned to a ename like (setq startpoint and (setq endpoint of each line [so i can calulate the angles or distance from one end point to some where] of each line so I can extend an trim in one commad with out hold shift down or use it in some other command in the future some times the angle will be differant then the entsel like if it say it is 210 I might need 30

*Expert Elite*
Kent1Cooper
Posts: 5,242
Registered: ‎09-13-2004
Message 35 of 36 (89 Views)

Re: want to select several objects and get srating and endpoint of each one

05-16-2013 06:28 AM in reply to: cadking2k5

cadking2k5 wrote:

... I am trying to make it so I can select several lines at once and get each end point asigned to a ename like (setq startpoint and (setq endpoint of each line [so i can calulate the angles or distance from one end point to some where] of each line so I can extend an trim in one commad with out hold shift down or use it in some other command in the future some times the angle will be differant then the entsel like if it say it is 210 I might need 30


[I think you must mean "assigned to a variable" rather than to an "ename."]  Are you looking for an individual variable name for every endpoint on the selected objects?  That can certainly be done, but I wonder how you would use them.  What kind of variable names would you want to use?

 

Or would it be better to tie them to the object they are the endpoints of, somehow?  In pbejse's first post here [Message 9], if you change the first line from

 

(defun c:see (/ *error* eName eNames)

 to

(defun c:see (/ *error* eName)

 

[that is, take eNames out of the localized variables list], run it, and select several Lines, it will result in a variable called eNames that contains a list of sublists, with each sublist containing a Line entity name and a list of its start- and endpoints.  Type !eNames to see the list.  Is that a way of organizing the points that would be useful to you?  If not, would a slight difference be better, such as removing the points from their paired lists and having each sublist be just (entity-name startpoint endpoint)?  Or something else?

 

Also, I would find it very much easier to read your messages with some punctuation in them.  It serves a real and useful purpose.  I saw a T-shirt recently that said:

 

Let's eat Grandma.

Let's eat, Grandma.

Punctuation saves lives!

Kent Cooper
*Expert Elite*
Kent1Cooper
Posts: 5,242
Registered: ‎09-13-2004
Message 36 of 36 (77 Views)

Re: want to select several objects and get srating and endpoint of each one

05-16-2013 08:59 AM in reply to: cadking2k5

cadking2k5 wrote:

....I am trying to ... extend an trim in one commad with out hold shift down ....


Check out the combined Trim/Extend command [command name: TrimEx] here.  It uses a clever approach that would not have occurred to me -- after you select a boundary edge [or edges], for each selected object to Trim/Extend, it simply tries Trim on it and then tries Extend.  If it crosses a boundary, the Trim command works and [if there aren't multiple boundaries in the wrong kinds of places] the Extend command does nothing; if it doesn't cross, the Trim does nothing and the Extend works.  It has no limitation on entity types, beyond what's allowed in either basic command, and no points need to be calculated or saved to variables.  It lets you select multiple boundary edges, though in brief trial doing that, I find it can sometimes be a little unpredictable, depending on their geometric relationship, because some things might be trimmable to one boundary and extendable to another.  But in the kinds of things you want to do with it, that may not be a concern.  For the situation you have described in message 26, turn EDGEMODE on [1].  Try it out -- it may do what you're looking for.

Kent Cooper

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community