Recent Posts

Pages: [1] 2 3 ... 10
1
.NET / Editor.TraceBoundary documentation mistake
« Last post by Zeftax on Today at 03:50:10 AM »
The Developer Help page for Editor.TraceBoundary (https://help.autodesk.com/view/OARX/2023/ENU/?guid=OARX-ManagedRefGuide-Autodesk_AutoCAD_EditorInput_Editor_TraceBoundary_Point3d__MarshalAsUnmanagedType_U1__bool) seems to have a mistake, they say:
Quote
In this case, the last entry is the outermost boundary, and the succeeding entries represent the islands found.
The sentence is obviously self-contradictory, but if one is to take just the key part (the last entry is the outermost), he will take away the wrong part! In fact, the first entity in the set is the outermost one, and the succeeding ones (as is written correctly) are the islands. Just a fun little mistake I stumbled upon this morning, so beware!  :uglystupid2:
2
.NET / Re: Selection Set by Fence
« Last post by kdub_nz on Today at 03:24:04 AM »

Tanks.
Credit goes to Scott McFarlane in a lecture  "Programming AutoCAD with C#: Best Practices" at AutoDesk University.

also:
from2014, have a look for
2014 handout_5215_SD5215 Sharpen Your Code.pdf
2014 presentation_5215_SD5215 Sharpen Your Code.pptx

I currently use a class named AcActive ( with a bit more content ) to reduce the name conflict with Active Class used by other developers.
3
AutoLISP (Vanilla / Visual) / Re: purge everything but layers
« Last post by kozmos on Today at 03:05:08 AM »
This could be of a use .  :-D

Code - Auto/Visual Lisp: [Select]
  1. (defun c:test (/ l p)
  2.   (while
  3.     (setq l (tblnext "LAYER" (null l)))
  4.      (setq p (cons (entmakex (list '(0 . "POINT")
  5.                                    (list 10 0. 0. 0.)
  6.                                    (cons 8 (cdr (assoc 2 l)))
  7.                              )
  8.                    )
  9.                    p
  10.              )
  11.      )
  12.   )
  13.   (repeat 3
  14.     )
  15.   )
  16.   (foreach x p (entdel x))
  17.   (princ)
  18. )

I would suggest to vla-copy the layers into dbx and then copy them back after purging the dwg.
4
.NET / Re: Selection Set by Fence
« Last post by Zeftax on Today at 02:49:08 AM »
Code - C#: [Select]
  1.     public static class Active
  2.  

Woah, that's a smart trick! :-o I'll have to use that from now on.
5
AutoLISP (Vanilla / Visual) / Re: purge everything but layers
« Last post by BIGAL on May 15, 2024, 08:18:55 PM »
If you are using CIV3D run Purgestyleandsettings maybe twice before normal purge. It makes a big difference.
6
AutoLISP (Vanilla / Visual) / Re: Issue with Layout - Copy Command
« Last post by BIGAL on May 15, 2024, 08:15:24 PM »
Are you copying "Template" each time or last layout name created, may cause odd order.
7
AutoLISP (Vanilla / Visual) / Re: ALternative to ade_odgettables in BricsCAD
« Last post by BIGAL on May 15, 2024, 08:12:11 PM »
Did you ask at Bricscad forum or do a support request ? Bricscad staff do read the posts and respond.
8
AutoLISP (Vanilla / Visual) / Re: purge everything but layers
« Last post by 3dwannab on May 15, 2024, 07:21:05 PM »
As an aside, note that the purgeall method will also skip Multileader Styles when purging a drawing - this is a known bug.
Wow, 12 years on and this bug remains.

I guess this will have to do:
Code: [Select]
  ;; Purge using vla and normal method to purge MULTILEADERS as there's a bug with that using the vla method.
  (setq doc (vla-get-activedocument (vlax-get-acad-object)))
  (repeat 3 (vla-purgeall doc))
  ; Purge MULTILEADERS (no prompt), the above code doesn't purge MULTILEADERS. Known bug: https://www.theswamp.org/index.php?topic=42854.msg480733#msg480733
  (command "_.PURGE" "_MU" "*" "_N")
9
AutoLISP (Vanilla / Visual) / Re: How to Access Microsoft Graph via Visual Lisp?
« Last post by MickD on May 15, 2024, 04:51:41 PM »
Quote
I believe this would be the same concept as hard-coding it into our acad.lsp file

I'm not sure what you mean by this, your lisp just queries your api to get the data for the user (like your json return sample) and do what you need. If you mean you are using/instructing Graph itself to install MS app's (not lisp/arx app's in cad) then I understand.

As I mentioned, you can also use the web app as a go between to Graph (IT can still handle profiles), then you only need to register one application with Graph, only users on company machines will have access to the web app via your lisp so security risks are minimal.
Your problem at the moment is you would need to use some authentication to gain access and you don't want or need each user to have direct access, your lisp with web app is the gate keeper.

I hope that makes sense :)
10
AutoLISP (Vanilla / Visual) / Issue with Layout - Copy Command
« Last post by jnelson on May 15, 2024, 04:25:52 PM »
I have an existing lisp routine that makes copies of an existing "template" layout one by one using an alphabetized list of layout names.  For example, the "template" layout is named "TEMPLATE" and (to keep things simple) the list of names might be "A", "B", "C", etc.  The "Template" layout name is assigned to the TBLAYOUT variable, and the desired name of the copy is assigned to a variable named MAP.  The code looks like:

(command "layout" "copy" TBLAYOUT MAP)

This works fine, and the new layouts have previously all been arranged together at the bottom of the drawing editor in alphabetical order:

Model/A/B/C/D/E/TEMPLATE

However, beginning with AutoCAD 2019 and now AutoCAD 2024 (we skipped the versions in between) the new layouts do not stay in alphabetical order.  Instead, they may be arranged such as:

Model/C/D/E/TEMPLATE/A/B

This is not a big deal if there are a dozen or so layouts, but sometimes we have over a hundred and they can be annoying to put in order.  We do use Lee Mac's TabSort routine to fix it, but I'd like to get it right the first time, since the list is already in alphabetical order.

Any ideas why this is happening, and is there a simple solution that I'm overlooking?  Thank you.
Pages: [1] 2 3 ... 10