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

0 Members and 1 Guest are viewing this topic.

xdcad

  • Swamp Rat
  • Posts: 527


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.       (progn
  11.         (xdrx-setpropertyvalue outline "color" 1)
  12.         (setq outlines (cons (entlast) outlines))
  13.         (xdrx-entity-redraw outlines 1)
  14.       )
  15.     )
  16.   )
  17.   (xdrx-end)
  18.   (princ)
  19. )
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net

domenicomaria

  • Swamp Rat
  • Posts: 743
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 ...

xdcad

  • Swamp Rat
  • Posts: 527
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.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net

domenicomaria

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

... while I am about to
definitively switch to BricsCAD 2024 ...

... and I hope it is a good choice ...

... is there a good version of
XDRX-API for bricsCAD ?