Small Fish Posted July 7, 2010 Posted July 7, 2010 Maybe an easy one... If I use the command "break" to break a line into 2 entities, then how can I capture it into 2 new separate variables. If I use (setq e1 (entlast)) it will only return one side of the break. How can I save the two sides into 2 separate values. As I said it could be easy to solve- but its got me beat. thanks Quote
Lee Mac Posted July 7, 2010 Posted July 7, 2010 Only one entity should be created, hence the variable pointing to the original entity before the break is the other entity. Quote
alanjt Posted July 7, 2010 Posted July 7, 2010 One object be what you selected and the other would be with entlast, after break command has been executed. Quote
alanjt Posted July 7, 2010 Posted July 7, 2010 Oops, forgot to attach. eg. (defun _Break (ent pt) (command "_.break" ent "_non" pt "_non" pt) (list ent (entlast)) ) (_Break (car (entsel)) (getpoint)) Quote
Small Fish Posted July 7, 2010 Author Posted July 7, 2010 Thanks that makes perfect sense, although I am still struggling with some code. The real problem is trimming. In my picture I am breaking a line, inserting the breakline symbol, then trimming the line(this is where I get stuck) (setq pt1 (getpoint "\nSpecify first point for breakline: ")) (setq pt2 (getpoint pt1 "\nSpecify second point for breakline: ")) (setq BrkScale 1) (command "line" pt1 Pt2 "") (setq e1 (entlast)) (setvar "OSMODE" 512) (setq ptBrk (getpoint "\nPick point for break symbol")) (command "break" e1 ptBrk ptBrk) (setq e2 (entlast)) (command ".INSERT" "BRKLINE2" ptBrk BrkScale;scale "" pt1 pt2 ;angle ) (setq e3(entlast)) (command ".TRIM" e3 "" e1 "");these are the (command ".TRIM" e3 "" e2 "");problem lines Quote
Small Fish Posted July 7, 2010 Author Posted July 7, 2010 Thats true - but I am writing something much better. One of things I want too have is, the option of putting as many break line symbols until Enter is pressed. - I have my code in a while loop to do this. Code posted is just a snippet. I am almost there - I just need to trim the line. I thought that would be the easy bit. Quote
alanjt Posted July 7, 2010 Posted July 7, 2010 Take the actual distance of the block, then use POLAR from the first point (also insertion point of block) and the angle b/w the two picked points to determine the two break points along the line. Quote
Lee Mac Posted July 7, 2010 Posted July 7, 2010 I think I did something like that a while back here. Quote
Recommended Posts
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.