Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
AutoLISP (Vanilla / Visual) / Modify Lee Lisp BFind to run on opened drawings only
« Last post by HasanCAD on April 17, 2024, 07:07:45 AM »
I am using LEE lisp BFind (thanks LEE)
How to modify the lisp to this setting and use as default.
- Only to run on opened drawings only.
- Clear saved list.

Thanks
22
AutoLISP (Vanilla / Visual) / Re: Ssget filter for mirrored multileader
« Last post by dexus on April 17, 2024, 04:38:13 AM »
Yes, I found it. Thank you!
I did have to add the first 11 to the <or set as well:
Code - Auto/Visual Lisp: [Select]
  1.   '(
  2.     (0 . "MULTILEADER")
  3.     (-4 . "<or")
  4.       (11 -1.0  0.0  0.0)
  5.       (11  0.0 -1.0  0.0)
  6.       (11  0.0  0.0 -1.0)
  7.     (-4 . "or>")
  8.   )
  9. )
23
AutoLISP (Vanilla / Visual) / Re: Ssget filter for mirrored multileader
« Last post by ribarm on April 17, 2024, 04:23:50 AM »
Try this :

Code - Auto/Visual Lisp: [Select]
  1. (setq ss (ssget (list (cons 0 "MULTILEADER") (list 11 0.0 0.0 -1.0) (cons -4 "<or") (list 11 -1.0 0.0 0.0) (list 11 1.0 0.0 0.0) (cons -4 "or>"))))
  2.  
24
AutoLISP (Vanilla / Visual) / Ssget filter for mirrored multileader
« Last post by dexus on April 17, 2024, 04:13:22 AM »
Hi all,

I'm trying to select only mirrored multileaders, but I cant seem to get the ssget filter correct.

The normal of a multileader is set in the first appearance of dxf code 11 and if it is mirrored, it is set to (0.0 0.0 -1.0)

But other things like where the leaders are connected are also saved in dxf code 11.

If I try to match it directly it doesn't match anything because not all the 11's are the same:
Code - Auto/Visual Lisp: [Select]
  1. (ssget '((0 . "MULTILEADER") (11 0.0 0.0 -1.0)))

If I try to find all the non default normals it matches non-mirrored multileaders as well, because it matches the second 11 as non default:
Code - Auto/Visual Lisp: [Select]
  1. (ssget '((-4 . "<and") (0 . "MULTILEADER") (-4 . "!=") (11 0.0 0.0 1.0) (-4 . "and>")))

Is it possible to set an ssget filter for only the first appearance of 11?
Or is there another way to do this?
25
need alignit.lsp also.
26
AutoLISP (Vanilla / Visual) / Intermittent Error - Ideas on Resolution Appreciated
« Last post by CEHill on April 16, 2024, 06:32:39 PM »
An old chestnut of a program, alignit.lsp, was copied from Cadalyst many years ago. Two files, alignit.lsp and alignit.dcl, are attached.
This program allows the user to choose from several reference positions i.e., top, bottom, left, right of source text and aligns selected destination text.

NOTE: A shortened command, ALI, is the only modification that was made to the program.

ISSUE: The program will run for a few iterations and then will fail.

From program start to code error:
Command: ALI
Select the fixed entity
Select entity:
Select the entities to be aligned
ALIGNIT - Error: Automation Error E_FAIL; [IAcadSelectionSets] function [ADD] unspecified error
SYSTEM VARIABLES have been reset


Can someone provide clues on why it is failing?

FYI: I now use BricsCAD. 
27
AutoLISP (Vanilla / Visual) / Re: Button Macro Fails for OVERKILL. Why?
« Last post by tombu on April 16, 2024, 01:43:43 PM »
Keep in mind there are a ton of settings for the OVERKILL command that affect outcome and could cause it to fail normally set in it's dialog box but can be set in lisp as well.
28
XDRX-API / [XDrX-PlugIn(145)] Fixed Hatch with area 0
« Last post by xdcad on April 16, 2024, 09:23:18 AM »
https://www.cadtutor.net/forum/topic/77056-i-can-not-calculate-the-area-of-this-hatch



Code: [Select]
(defun c:xdtb_hafix0 (/ ha ha1 ha-new has loop loops mp old-boundary progress re ss x)
  (defun _delete-old-boundary (loops)
    (mapcar
      '(lambda (loop)
(if (and
       (setq ss (ssget "f" (xdrx-getpropertyvalue loop "vertices") '((0 . "*line,arc,ellipse,circle"))))
       (ssdel loop ss)
       (> (sslength ss) 0)
     )
   (progn
     (mapcar
       '(lambda (x)
  (setq re (xdrx-geom-relation loop x t))
  (if (or
(= re XD:kTangent)
(= re XD:kBoundary)
(= re XD:kCoincident)
      )
    (xdrx-entity-delete x)
  )
)
       (xdrx-ss->ents ss)
     )
   )
)
       )
      loops
    )
  )
  (if (and
(setq ha (xdrx-ssget (xdrx-string-multilanguage "\n选择填充对象<退出>:" "\nSelect Hatch<Exit>:") '
     ((0 . "hatch"))
)
)
(setq has (xdrx_hatch_get0area ha))
      )
    (progn
      (xdrx-begin)
      (xdrx-sysvar-push '("fitarc" 0))
      (xdrx-document-safezoom ha)
      (xdrx_statusbar_begin (xdrx-string-multilanguage "处理中..." "Procesing...") (length has))
      (setq progress 0)
      (mapcar
'(lambda (x)
   (xdrx_statusbar_setpos (setq progress (1+ progress)))
   (if (setq mp (xdrx-hatch->mpolygon x))
     (progn
       (setq ha1 (xdrx-mpolygon->hatch mp))
       (xdrx-entity-matchprop x ha1)
       (setq ha x
     ha-new (car (xdrx-ss-getsub ha1 '((0 . "hatch"))))
     loops (xdrx-getpropertyvalue ha-new "assocobjids")
       )
       (if (setq old-boundary (xdrx-getpropertyvalue x "assocobjids"))
(progn
   (xdrx-entity-delete old-boundary)
)
(progn
   (_delete-old-boundary loops)
)
       )
       (xdrx-object-swapid ha ha-new)
       (xdrx-entity-delete ha-new)
     )
   )
)
has
      )
      (xdrx_statusbar_end)
      (xdrx-prompt (xdrx-string-formatex (xdrx-string-multilanguage "\n修复了 %d 个面积为0的填充."
    "\nFixed %d Hatchs with area 0."
) (length has)
   )
      )
      (xdrx-sysvar-pop)
      (xdrx-end)
    )
  )
  (princ)
)
29
AutoLISP (Vanilla / Visual) / Re: Help: Set drawing scale DCL lisp
« Last post by BIGAL on April 16, 2024, 02:53:08 AM »
Thought I did but added to prior post. Note the dcl is written to a directory of my choice d:\acadtemp change to suit.
30
XDRX-API / [XDrX-PlugIn(144)] Dynamically insert SPLINE FIT points
« Last post by xdcad on April 16, 2024, 12:32:18 AM »

https://www.cadtutor.net/forum/topic/83389-simple-addremove-fit-points-on-a-spline/

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

The code below, using XDRX - API,
Before trying the forum code, please download and install XDRX - API

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

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

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

Code: [Select]
(defun c:xdtb_spldynfit (/ dynpt fitpnt inx lastpnt spl)
  (defun _callback (dynpt)
    (if (not (equal dynpt lastpnt))
      (xdrx-spline-setfitpointat spl inx dynpt)
    )
    (setq lastpnt dynpt)
  )
  (xdrx-begin)
  (xdrx-sysvar-push '("osmode" 512))
  (if (and
(setq spl (car (xdrx-entsel (xdrx-string-multilanguage "\n拾取SPLINE<退出>:" "\nPick Spline<Exit>:")
    '((0 . "spline"))
       )
  )
)
(xdrx-entity-redraw spl 1)
(setq fitpnt (getpoint (xdrx-string-multilanguage "\n点取新增Fit点位置<退出>:" "\nClick to select the new Fit point location<Exit>:")))
(setq inx (xdrx-spline-insertfitpointat spl fitpnt))
      )
    (progn
      (xdrx-entity-redraw spl 4)
      (xdrx-pointmonitor "_callback")
      (getpoint)
      (xdrx-pointmonitor)
    )
  )
  (xdrx-sysvar-pop)
  (xdrx-end)
  (princ)
)
Pages: 1 2 [3] 4 5 ... 10