Recent Posts

Pages: 1 2 3 [4] 5 6 ... 10
31
CAD General / *Cancel* during startup of first document in session.
« Last post by kdub_nz on April 22, 2024, 02:25:23 AM »
After 40+ years  I thought I'd try to discover why we get a ( or some ) *Cancel* messages during the startup of the initial drawing in a session.

attached are some images of the Console,  LoadedApps and Options.

The message 'AutoCAD menu utilities loaded' originate from the Acad2025doc.lsp ;

Line 574:            (princ "\nAutoCAD menu utilities ")
and line 1093:     (princ "loaded.")

So, sometime after Acad2025doc.lsp is loaded there are several issues that cause the *Cancel* message to display.
It appears that the issue 'MAY' ( assumption ) be related to menus,  ribbons and toolpalettes.

Firstly:   Does anyone know why this happens ?
Second: Is there anyone who hasn't seen these messages ?

Regards,

added: also posted at https://forums.autodesk.com/t5/autocad-forum/cancel-during-startup-of-first-document-in-session/m-p/12724323#M1129390

32
AutoLISP (Vanilla / Visual) / Re: 3d polyline splitting
« Last post by mariolino0099 on April 22, 2024, 02:21:15 AM »
Marko many thanks,
the code should do the splitting as shown in the image. Basically introduced the user length (0.7 in the example), do the splitting of each individual segment of the 3dpoly and then round to the nearest integer and use a different splitting length for each segment
thanks
33
Code: [Select]
(defun c:xdtb_erase_coincide (/ ss lens ents nums)
  (xdrx-begin)
  (if (and (setq ss (xdrx-ssget
      (xdrx-string-multilanguage
"\n选择要处理的对象<退出>:"
"\nSelect objects to process <Exit>:"
      )
    )
   )
   (setq lens (sslength ss))
   (setq ents (xd::pickset:coincide ss))
      )
    (progn
      (setq nums 0)
      (mapcar '(lambda (x)
(xdrx-entity-delete (setq coins (cdr x)))
(setq nums (+ nums (length coins)))
       )
      ents
      )
      (xdrx-prompt
(xdrx-string-formatex
  (xdrx-string-multilanguage
    "\n搜寻实体 %d ...\n共发现 %d 组重合的对象...\n删除了其中 %d 个重合实体."
    "\nSearching for entities %d...\nA total of %d groups of Coincide objects were found...\n%d of the coinciding entities were deleted."
  )
  lens
  (length ents)
  nums
)
      )
    )
    (progn
      (xdrx-prompt
(xdrx-string-multilanguage
  "\n没有发现重合实体."
  "\nNo coinciding entities found."
)
      )
    )
  )
  (xdrx-end)
  (princ)
)

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

The above LISP code uses the XDRX-API, which can be downloaded from https://github.com/xdcad/XDrx-API

The XDRX API encapsulates AcDb, AcEd, AcGe, AcBr... C++ library, using C++ methods to develop LISP programs.Thousands of Lisp functions are available.
Modify message
34
XDRX-API / [XDrX-PlugIn(154)] Get the total length of overlapping segments
« Last post by xdcad on April 21, 2024, 09:57:42 PM »

1. xdrx-pointmonitor 

    Through the point monitor callback function _callback, draw dynamic memory MTEXT, POLYLINE screen vector, and dynamic drag



2. xd::geom:getoverlaps

    Get Entitiy List of overlapping segments 

Code: [Select]
;|
Functions: Obtain the memory geometric entities of the overlapping segments of two polylines (determine whether the two polylines will overlap in the future)

parameter:
    1. e1,e2 ---- polyline entity name, or geometric entity name, or point table
    2. mode --- t: returns the geometric entity table, nil: returns t or nil
|;
(defun xd::geom:getoverlaps (e1 e2 mode / g1 g2 gint curveint ret _getparam ranges ranges1)
  (defun _getparam (e1 / g1)
    (cond
      ((= (type e1) 'list)
       (setq g1 (xdge::constructor "kCompositeCrv3d" e1))
      )
      ((and (= (type e1) 'ename)
    (xdrx-object-iskindof e1 "AcDbCurve")
       )
       (setq g1 (xdge::constructor e1))
      )
      ((xdge::type e1)
       t
      )
      (t
       (setq g1 nil)
      )
    )
    g1
  )
  (setq g1 (_getparam e1)
g2 (_getparam e2)
  )
  (if (and g1 g2)
    (progn
      (setq curveint (xdge::constructor "kCurveCurveInt3d"))
      (setq gint (xdge::setpropertyvalue curveint "set" g1 g2))
      (setq ret (> (xdge::getpropertyvalue gint "numOverlaps") 0))
      (if (and mode ret)
(progn
  (setq ranges (xdge::getpropertyvalue gint "overlapranges" t)
ranges1 (mapcar 'car ranges)
  )
  (setq ret
(mapcar '(lambda (x)
    (setq tmp (xdge::copy g1))
    (xdge::setpropertyvalue tmp "setinterval" x)
  )
ranges1
)
  )
)
      )
    )
  )
  (xdge::free g1 g2 curveint gint ranges)
  ret
)

Code: [Select]
(defun c:tt ()
  (defun *error* (msg)
    (xdrx-entity-delete ents)
    (xdrx-pointmonitor)
    (xdrx-end)
    (redraw)
  )
  (defun _callback (dynpt)
    (redraw)
    (xd::pnts:mark verts 2 0.025)
    (xdrx-setpropertyvalue
      ents
      "constantwidth"
      (* (getvar "viewsize") 0.015)
      "color" 6
    )
    (xdrx-grdraw 6 ents)
    (xd::grdraw:drawtext
  txt
  totallen
  (polar dynpt (/ pi 4.0) (/ (xd::doc:getpickboxheight) 2.0))
  1
  (* (getvar "viewsize") 0.03)
  6
  (getvar "ucsxdir")
  nil
  8
)
   
  )
  (xdrx-begin)
  (if (and (setq e1 (car (xdrx-entsel
   (xdrx-string-multilanguage
     "\n拾取第一条多段线<退出>:"
     "\nPick the first polyline<Exit>:"
   )
   '((0 . "*polyline"))
)
    )
   )
   (setq e2 (car (xdrx-entsel
   (xdrx-string-multilanguage
     "\n拾取第一条多段线<退出>:"
     "\nPick the first polyline<Exit>:"
   )
   '((0 . "*polyline"))
)
    )
   )
      )
    (progn
      (if (setq data (xd::geom:getoverlaps e1 e2 t))
(progn
  (setq txt (xdrx-mtext-make)
nums (length data)
tlen (apply '+ (xdrx-getpropertyvalue data "length"))
totallen (xdrx-string-formatex
   (xdrx-string-multilanguage
     "重叠段 %d,总长度 %.1f\r\n"
     "Overlapping segment %d.\r\nTotal length=%.1f"
   )
   nums
   tlen
)
verts (xdrx-getpropertyvalue data "vertices")
ents (xdrx-entity-make data)
verts (xd::list:flat-point verts)
  )
  (xdrx-pointmonitor "_callback")
  (if (getpoint)
    (progn
      (xdrx-entity-make txt)
    )
  )
  ;(xdrx-entity-delete ents)
  (xdrx-pointmonitor)
)
      )
    )
  )
  (redraw)
  (xdrx-end)
  (princ)
)

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

The above LISP code uses the XDRX-API, which can be downloaded from https://github.com/xdcad/XDrx-API

The XDRX API encapsulates AcDb, AcEd, AcGe, AcBr... C++ library, using C++ methods to develop LISP programs.Thousands of Lisp functions are available.
35
AutoLISP (Vanilla / Visual) / Re: Align Multiple Text Objects to Curve
« Last post by xdcad on April 21, 2024, 09:52:51 PM »

Quote

Dear Sir,
i downloaded the file and save to lsp file but has an error. tnx
ReyAs

Have you downloaded the API compressed package at https://github.com/xdcad/XDrx-API, decompressed it, and installed the files inside?
During installation, check all of them. After installation, start ACAD and check with F2. There will be a prompt whether the API is loaded.

=======

┌───────────────────────────────────┐
│  ≡ XDRX_API For AutoCAD Build 2024.04.28 ≡  │
│  http://www.xdcad.net  Mail:7598165@qq.com  │
└───────────────────────────────────┘

========


If normal,

It is possible to run the forum LISP
36
PERFECT!!! I thank you very much, 'Prince'! :smitten:

Clint
37
AutoLISP (Vanilla / Visual) / Re: Align Multiple Text Objects to Curve
« Last post by reyas1123 on April 21, 2024, 07:36:21 AM »

You can specify the distance after alignment





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

Dear Sir,
i downloaded the file and save to lsp file but has an error. tnx
ReyAs
38
AutoLISP (Vanilla / Visual) / Re: Ssget filter for mirrored multileader
« Last post by ribarm on April 20, 2024, 04:09:33 PM »
Correct...
It selects in AutoCAD 2022 on my Laptop...
39
AutoLISP (Vanilla / Visual) / Re: Ssget filter for mirrored multileader
« Last post by ronjonp on April 20, 2024, 03:41:02 PM »
This works for me on your sample drawing.
Code - Auto/Visual Lisp: [Select]
  1. (sssetfirst nil (ssget "_X" '((0 . "MULTILEADER") (13 -1.0 0.0 0.0))))
40
This part :

Code - Auto/Visual Lisp: [Select]
  1.     (setq test1 (car (_vl-times)))
  2.     (repeat 100 (_getNumPoints ent) )
  3.     (setq test2 (car (_vl-times)))
  4.     (repeat 100 (_getPoints ent) )
  5.     (setq test (car (_vl-times)))
  6.     (princ "\n_getNumPoints: ")
  7.     (princ (- test test1))
  8.     (princ "\n_getPoints:    ")
  9.     (princ (- test test2))
  10.  

Should be :

Code - Auto/Visual Lisp: [Select]
  1.     (setq test1 (car (_vl-times)))
  2.     (repeat 100 (_getNumPoints ent) )
  3.     (setq test2 (car (_vl-times)))
  4.     (repeat 100 (_getPoints ent) )
  5.     (setq test3 (car (_vl-times)))
  6.     (princ "\n_getNumPoints: ")
  7.     (princ (- test2 test1))
  8.     (princ "\n_getPoints:    ")
  9.     (princ (- test3 test2))
  10.  
Pages: 1 2 3 [4] 5 6 ... 10