### Author Topic: [XDrX-Function(10)] Extract block outlines (supports unequal scale)  (Read 404 times)

0 Members and 1 Guest are viewing this topic.

• Bull Frog
• Posts: 424
##### [XDrX-Function(10)] Extract block outlines (supports unequal scale)
« on: December 06, 2023, 09:36:44 AM »

xdrx-geom-searchoutline <e1..ss1..e2..s2> [mode] [nil or t] [nil or t])
Parameter Description:
1. e1..s1..: Any combination of entities and selection sets
2. mode:    -1,0,1,2
-1 (default) uses the API system variable BoundaryType value （xdrx-setvar "boundarytype" <0,1,2>)
0: Scattered native curves, LINE, ARC...
1: POLYLINE border
2: SPLINE boundary
3. The first T or NIL or None: T returns the point list
4. The second T or NIL or None: delete the original selection set and entities, leaving only the boundaries

=========================

What's important is that：

1. It supports unequal proportions of tiles
2. For ellipses, the ellipses transformed from circles of unequal proportions are not fitted with straight lines, but with "double
arcs" that are tangent at the end.
3. In the future, SPLINE will also support double arc fitting, making it smoother
4. Its sister functions are: xdrx-geom-searchregions, one is to search the outer contour, and the other is to search the inner closed region

Code - Auto/Visual Lisp: [Select]
1. (defun c:tt (/ outlines)
2.   (xdrx-begin)
3.   (xdrx-setvar "boundaryType" 1);//2:&#29983;&#25104;&#36793;&#30028;&#29992;SPLINE&#65292;1&#65306;POLYLINE
4.   (while (setq e (xdrx-entsel
5.                    "\nPick the block that generates the outline<Exit>:"
6.                    '((0 . "insert"))
7.                  )
8.          )
9.     (if (setq outline (xdrx-geom-searchoutline e))
10.         (xdrx-setpropertyvalue outline "color" 1)
11.         (setq outlines (cons (entlast) outlines))
12.         (xdrx-entity-redraw outlines 1)
13.       )
14.     )
15.   )
16.   (xdrx-end)
17.   (princ)
18. )
The code I wrote uses XDRX-API，which can be downloaded from github.com and is updated at any time.
===================================
[XDrx-Sub Forum]
https://www.theswamp.org/index.php?board=78.0

#### domenicomaria

• Swamp Rat
• Posts: 720
##### Re: [XDrX-Function(10)] Extract block outlines (supports unequal scale)
« Reply #1 on: December 06, 2023, 11:50:42 AM »
in certain situations it works, in others, (very often) it blocks everything ... it enters an infinite loop ... and it is not possible to block it ... you have to do ctrl+alt+del ...

• Bull Frog
• Posts: 424
##### Re: [XDrX-Function(10)] Extract block outlines (supports unequal scale)
« Reply #2 on: December 06, 2023, 11:54:41 AM »
in certain situations it works, in others, (very often) it blocks everything ... it enters an infinite loop ... and it is not possible to block it ... you have to do ctrl+alt+del ...

Which version of AUTOCAD are you using? When there is a new version, I will send it directly to your email
The code I wrote uses XDRX-API，which can be downloaded from github.com and is updated at any time.
===================================
[XDrx-Sub Forum]
https://www.theswamp.org/index.php?board=78.0

#### domenicomaria

• Swamp Rat
• Posts: 720
##### Re: [XDrX-Function(10)] Extract block outlines (supports unequal scale)
« Reply #3 on: December 07, 2023, 01:50:52 AM »