Jump to content

Direction of a construction line (xline)


TunzaGibbo

Recommended Posts

Thank you

I only knew the last 2 lines.

Well done

 

(setq Segments (getreal "\nNumber of Segments::"))
(setq ent (car (entsel "\nSelect line :")))
  (setq lst (entget ent))
  (setq startpoint (cdr (assoc 10 lst)))
  (setq end (cdr (assoc 11 lst)))
  (setq len (distance startpoint end)) ;; length
  (setq ang (angle startpoint end))
  (command "_xline" "A" (+ ang 90) startpoint "")
  (setq Conline (entlast))
(command "_copy" Conline "" "O" "M" startpoint "A" segments (polar startpoint ang (/ len segments)))

with this one I have a line and want to insert an XLINE at 90 deg to that line staring at "startpoint" and then copy that the XLINE along "Conline" a distance of "len" divide by "segments"

 

Example: Line 200 long result would be Segments=10 I would have 11 Xlines spaced equally along the 200 line

 

regards

 

Tony 

Link to comment
Share on other sites

  • Replies 24
  • Created
  • Last Reply

Top Posters In This Topic

  • TunzaGibbo

    13

  • Tharwat

    10

  • BIGAL

    1

  • Grrr

    1

Top Posters In This Topic

Posted Images

Thank you

I only knew the last 2 lines.

Well done

(setq Segments (getreal "\nNumber of Segments::"))
(setq ent (car (entsel "\nSelect line :")))
  (setq lst (entget ent))
  (setq startpoint (cdr (assoc 10 lst)))
  (setq end (cdr (assoc 11 lst)))
  (setq len (distance startpoint end)) ;; length
  (setq ang (angle startpoint end))
  (command "_xline" "A" (+ ang 90) startpoint "")
  (setq Conline (entlast))
(command "_copy" Conline "" "O" "M" startpoint "A" segments (polar startpoint ang (/ len segments)))

with this one I have a line and want to insert an XLINE at 90 deg to that line staring at "startpoint" and then copy that the XLINE along "Conline" a distance of "len" divide by "segments"

 

Example: Line 200 long result would be Segments=10 I would have 11 Xlines spaced equally along the 200 line

 

Everything works down to the end of the 9th line

 

regards

 

Tony 

Link to comment
Share on other sites

Although I'd use the vlax-curve-* functions...

You could try yourself with the polar function to calculate each point where every xline must intersect (by knowing the segment's length).

Also your first line doesn't seem correct, perhaps you wanted to use getint ?

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