Jump to content

Polyline extend


thekiki

Recommended Posts

Just some ideas get co-ords of pline sort on X&Y use a Intersect with to work out new bottom points then update pline co-ords. A little trick is can select pline near a corner and rearrange the points so start at that corner. Possibly the way I might go. Will think about it. Oh yeah people will understand CW or CCW.

 

image.png.54ae258b1bdefa010490aec585860efb.png

 

 

Link to comment
Share on other sites

I've found the other way to do that. First, i explode polylines and make extend to polyline. Than, i make the contour of all the polylines selected.

Link to comment
Share on other sites

Glad your happy to explode but can be done sometimes you just have to wait for an answer so plines remain. 

 

"contour of all the polylines selected" I dont understand this ?

Link to comment
Share on other sites

22 minutes ago, BIGAL said:

"contour of all the polylines selected" I dont understand this ?

bpoly maybe?

Link to comment
Share on other sites

Yes by bpoly, but using this method take a lot of time if i have hundred of polygons.

 

 

Link to comment
Share on other sites

  • 3 weeks later...

[XDrX-PlugIn(103)] Supper Extend (theswamp.org)

https://www.theswamp.org/index.php?topic=59151.0

 

Video_2024-04-12_184747.gif.f751af619cc520e69885e2d042e2509f.gif

 

Video_2024-04-12_185841.gif.87d266d67225ffcc29bd013ee30dfa02.gif

 

 

(defun c:xdtb_polyextend (/ e1 e2 e3 inx1 inx2 bak)
  (if (and (setq e1 (xdrx-entsel (xdrx-string-multilanguage "\n拾取多段线延伸起始边<结束>:"
							    "\nPick Polyline Extend start Edge<Exit>:"
				 )
				 '((0 . "*polyline"))
		    )
	   )
	   (or (setq e2	(xdrx-entsel (xdrx-string-multilanguage	"\n拾取延伸结束边<alone>:"
								"\nPick Extend end Edge<Exit>:"
				     )
				     '((0 . "*polyline"))
			)
	       )
	       t
	   )
	   (equal (car e1) (car e2))
      )
    (progn (xd::begin)
	   (setq inx1 (xdrx-getpropertyvalue (car e1) "onseg" (cadr e1))
		 inx2 inx1
	   )
	   (if e2
	     (setq inx2 (xdrx-getpropertyvalue (car e2) "onseg" (cadr e2)))
	   )
	   (if (setq e3	(xdrx-entsel (xdrx-string-multilanguage	"\n拾取目标边<退出>:"
								"\nPick Dest Edge<Exit>:"
				     )
				     '((0 . "*polyline,line,arc,circle"))
			)
	       )
	     (xdrx-polyline-extend inx1 inx2 e1 e3)
	   )
	   (xd::end)
    )
  )
  (princ)
)

 

 

 

Link to comment
Share on other sites

Thanks for your answer, but i have this message:

 

Commande: XDTB_POLYEXTEND
; erreur: no function definition: XDRX-STRING-MULTILANGUAGE
Commande:

Link to comment
Share on other sites

2 hours ago, thekiki said:

Thanks for your answer, but i have this message:

 

Commande: XDTB_POLYEXTEND
; erreur: no function definition: XDRX-STRING-MULTILANGUAGE
Commande:

 

need XDRX-API:

 

download link: 

xdcad/XDrx-API: Autolisp development library written in ObjectARX (github.com)

https://github.com/xdcad/XDrx-API

Link to comment
Share on other sites

2 hours ago, thekiki said:

Once download, what the follow steps!

 

Execute the EXE in the compressed package. It will be installed all the way by default and all ACAD versions will be checked.

After installation, after starting ACAD, there will be a prompt whether the API loading is successful.

Then you copy the forum code and execute the command.

Link to comment
Share on other sites

It's OK for English version (AutoCAD) but not for french version.

By the way, it's better to have this lisp, but if i have hundred of polygons, it takes nevertheless a lot of time.

Many thanks.

Link to comment
Share on other sites

3 hours ago, thekiki said:

It's OK for English version (AutoCAD) but not for french version.

By the way, it's better to have this lisp, but if i have hundred of polygons, it takes nevertheless a lot of time.

Many thanks.

 

1. What's wrong with the French version? The prompt string is garbled, or the program cannot be executed? Or is it that the French version cannot successfully load the API?

 

2. Doesn't extension require your mouse to pick up the interaction? Do you have a lot of POLYGON and want to do it in batches? Then tell me what you want to do, and how to tell the program which one you want to extend to which one?

Link to comment
Share on other sites

3 hours ago, thekiki said:

It's OK for English version (AutoCAD) but not for french version.

By the way, it's better to have this lisp, but if i have hundred of polygons, it takes nevertheless a lot of time.

Many thanks.

 

Select N polylines, and then extend all edges in the window to the specified polylines?

Link to comment
Share on other sites

I have this message:

Commande: XDTB_POLYEXTEND
; erreur: no function definition: XDRX-STRING-MULTILANGUAGE

 

Did you have the lisp without executing the program "XDRX-API..."

Link to comment
Share on other sites

 

6 hours ago, thekiki said:

It's OK for English version (AutoCAD) but not for french version.

By the way, it's better to have this lisp, but if i have hundred of polygons, it takes nevertheless a lot of time.

Many thanks.

 

Send one that can be processed in batches

 

Video_2024-04-15_214135.gif.690637469d8af8fdf1da60701459d3d1.gif

 

(defun c:xdtb_polyxextend (/ e3 ge ins ins1 inx1 inx2 pts ss verts verts1 x y)
  (if (and
	(setq pts (XD::Doc:GetPolygon (xdrx-string-multilanguage "\n请指定第一点"
								 "\nPlease specify the first point"
				      ) (xdrx-string-multilanguage "下一点" "Next point") 7
		  )
	)
	(setq ss (ssget "f" pts '((0 . "*polyline"))))
	(xdrx-entity-redraw ss 3)
      )
    (progn
      (xd::begin)

      (if (setq e3 (xdrx-entsel (xdrx-string-multilanguage "\n拾取目标边<退出>:" "\nPick Dest Edge<Exit>:") '
				((0 . "*polyline,line,arc,circle"))
		   )
	  )
	(progn
	  (setq ge (xdge::constructor "kcompositecrv3d" (xd::pnts:close pts)))
	  (mapcar
	    '(lambda (x)
	       (setq verts (xdrx-getpropertyvalue x "vertices")
		     ins (xdrx-curve-isinside ge verts t)
	       )
	       (if (and
		     (xdrx-curve-isclosed x)
		     (member (xdrx-getpropertyvalue x "startpoint") ins)
		   )
		 (progn
		   (setq verts1 (xd::list:subtract verts ins))
		   (xd::polyline:resetstartpoint x (car verts1))
		 )
	       )
	       (setq ins1 (mapcar
			    '(lambda (y)
			       (xdrx-getpropertyvalue x "nearindex" y)
			     )
			    ins
			  )
		     ins1 (vl-sort ins1 '(lambda (x y)
					   (< x y)
					 )
			  )
	       )
	       (setq inx1 (car ins1)
		     inx2 (last (xd::list:removetail ins1))
	       )
	       (xdrx-polyline-extend inx1 inx2 x e3)
	     )
	    (xdrx-ss->ents ss)
	  )
	)
      )
      (xd::end)
    )
  )
  (princ)
)

 

Link to comment
Share on other sites

2 hours ago, thekiki said:

I have this message:

Commande: XDTB_POLYEXTEND
; erreur: no function definition: XDRX-STRING-MULTILANGUAGE

 

Did you have the lisp without executing the program "XDRX-API..."

 

The English version is normal. Does the French version report this error?

Link to comment
Share on other sites

@XDSoft This person is asking for a solution WITHOUT your extension API.

 

You'll find that not everyone here wants to load a 3rd party API, and many CANNOT because of company policies. Since AutoLISP is a interpreted language, they don't need to install anything, thus not violating company I.T. policies that prevent them from installing anything without approval first. While I appreciate the usefulness of your API, not everyone wants here wants a solution including it.

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