Jump to content

Recommended Posts

Posted

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

Posted

Only one entity should be created, hence the variable pointing to the original entity before the break is the other entity.

Posted

One object be what you selected and the other would be with entlast, after break command has been executed.

Posted

Oops, forgot to attach.

 

eg.

(defun _Break (ent pt)
 (command "_.break" ent "_non" pt "_non" pt)
 (list ent (entlast))
)

(_Break (car (entsel)) (getpoint))

Posted

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

bline.jpg

Posted

FYI, there's an express tool that does this.

Posted

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.

Posted

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.

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