Author Topic: [XDrX-PlugIn(2)] Block bottom WIPEOUT  (Read 1309 times)

0 Members and 1 Guest are viewing this topic.

xdcad

  • Swamp Rat
  • Posts: 527
[XDrX-PlugIn(2)] Block bottom WIPEOUT
« on: November 23, 2023, 05:44:35 PM »
https://www.theswamp.org/index.php?topic=56646.30


You add WIPEOUT to INSERT, use the following, it is very concise, and directly puts the display order of WIPEOUT at the bottom of the entities inside the block, so as to cover the entities under the block without affecting the entities inside the block.

Code - Auto/Visual Lisp: [Select]
  1. (xdrx-insert-appendwipeout blkref box offset)
  2.  
  3. blkref --- insert entity name
  4. box    --- WIPEOUT rectangular box, such as (xdrx-entity-box....) generated
  5. offset  --- a real number, whether the BOX is offset, positive values are outward offset, negative values are inward offset, if not given, offset = 0.0



The following is the demo program. A small problem was discovered during the debugging process. The XDRX API was re-uploaded. You may need to re-download it.

Code - Auto/Visual Lisp: [Select]
  1. (defun c:tt ()
  2.   (if (setq blkref (xdrx-entsel "\nPick Insert<exit>:" '((0 . "insert"))))
  3.     (progn
  4.       (xdrx-begin)
  5.       (setq blkref (car blkref)
  6.             box    (xdrx-entity-box blkref)
  7.             offset (/ (distance (nth 0 box) (nth 3 box)) 10.0)
  8.                                         ; offset distance 1/10 of the box height
  9.       )
  10.       (vl-cmdf ".wipeout" "frame" "off")
  11.       ;;Turn off WIPEOUT border display
  12.       (xdrx-insert-appendwipeout blkref box offset)
  13.       (xdrx-draworder->top blkref)      ;Insert the entity display order to the top
  14.       (xd::drag:simplemove blkref "\nInsert Point:" 5 t) ;Move drag
  15.       (xdrx-end)
  16.     )
  17.   )
  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

Hugo

  • Bull Frog
  • Posts: 435
Re: [XDrX-PlugIn(2)] Block bottom WIPEOUT
« Reply #1 on: December 05, 2023, 10:37:51 AM »
Do you also have an idea how to set attributes on a background?
Autocad can't do that.
Thanks

xdcad

  • Swamp Rat
  • Posts: 527
Re: [XDrX-PlugIn(2)] Block bottom WIPEOUT
« Reply #2 on: December 06, 2023, 05:02:05 AM »
Do you also have an idea how to set attributes on a background?
Autocad can't do that.
Thanks

Upload a drawing of your work. If there are many situations, try to include various attributes as much as possible.
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

Hugo

  • Bull Frog
  • Posts: 435
Re: [XDrX-PlugIn(2)] Block bottom WIPEOUT
« Reply #3 on: December 06, 2023, 05:32:41 AM »
Attached is the dwg
I use the text background command (see image)
Thanks

xdcad

  • Swamp Rat
  • Posts: 527
Re: [XDrX-PlugIn(2)] Block bottom WIPEOUT
« Reply #4 on: December 06, 2023, 06:39:46 AM »
Attached is the dwg
I use the text background command (see image)
Thanks

How do you think this program would be more convenient for you if you wrote it?
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

Hugo

  • Bull Frog
  • Posts: 435
Re: [XDrX-PlugIn(2)] Block bottom WIPEOUT
« Reply #5 on: December 06, 2023, 07:05:44 AM »
Unfortunately, I don't know the commands from the XDRX API that make simple Lisp possible.
True, just a request, it doesn't have to be that way anyway.

Danke
« Last Edit: December 06, 2023, 07:16:32 AM by Hugo »

xdcad

  • Swamp Rat
  • Posts: 527
Re: [XDrX-PlugIn(2)] Block bottom WIPEOUT
« Reply #6 on: December 06, 2023, 10:43:28 AM »
Unfortunately, I don't know the commands from the XDRX API that make simple Lisp possible.
True, just a request, it doesn't have to be that way anyway.

Danke

I’m not asking you to write using XDRX API.
But what effects and requirements does this tool want to achieve?
It’s just a simple attribute. If there are any other requirements or ideas in a complex DWG
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

Hugo

  • Bull Frog
  • Posts: 435
Re: [XDrX-PlugIn(2)] Block bottom WIPEOUT
« Reply #7 on: December 06, 2023, 01:28:37 PM »
That's what I mean only for attributes

Quote
(defun c:blatt2txt ( / ssbl ssbln bl att a b );; ATT zu Text
  (setq ssbl (ssget '((0 . "INSERT"))))
  (repeat (setq ssbln (sslength ssbl))
    (setq bl (ssname ssbl (setq ssbln (1- ssbln))))
    (if (eq (cdr (assoc 66 (entget bl))) 1)
        (while (not (eq (cdr (assoc 0 (entget (if att (setq att (entnext att)) (setq att (entnext bl)))))) "SEQEND"))
          (setq a (member (assoc 210 (reverse (entget att))) (reverse (entget att))))
          (setq b (member (assoc 100 (reverse a)) (reverse a)))
          (entmakex (append (list '(0 . "TEXT")) b))
          (entmod (subst (cons 1 "") (assoc 1 (entget att)) (entget att)))
        )
    )
  )
  (princ)
)


http://www.lee-mac.com/mask.html
« Last Edit: December 06, 2023, 01:32:14 PM by Hugo »

xdcad

  • Swamp Rat
  • Posts: 527
Re: [XDrX-PlugIn(2)] Block bottom WIPEOUT
« Reply #8 on: December 09, 2023, 12:46:16 PM »
Unfortunately, I don't know the commands from the XDRX API that make simple Lisp possible.
True, just a request, it doesn't have to be that way anyway.

Danke

http://www.theswamp.org/index.php?topic=58857.0

Need to re-download the API
« Last Edit: December 09, 2023, 12:56:38 PM by xdcad »
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