Recent Posts

Pages: [1] 2 3 ... 10
1
.NET / Re: AutoCAD2025 and loading dependency dll's
« Last post by MickD on May 29, 2024, 10:59:47 PM »
I only have one .NET module left that I maintain in the app store. The framework version actually loaded just fine in 2025,
but I went ahead and used the conversion tool and ported it to Core.
:-o
Looks like I need to create another project just for this build...

I never tried to step into to it with the debugger though. I remember that .NET would load specific debugger depending on the .config settings.. so it may run, just not debug
I’m going to rewrite it in C++, I didn’t take the news of Microsoft depreciating framework well   :crazy2:

:)
2
.NET / Re: AutoCAD2025 and loading dependency dll's
« Last post by It's Alive! on May 29, 2024, 10:37:31 PM »
I only have one .NET module left that I maintain in the app store. The framework version actually loaded just fine in 2025,
but I went ahead and used the conversion tool and ported it to Core.

I never tried to step into to it with the debugger though. I remember that .NET would load specific debugger depending on the .config settings.. so it may run, just not debug
I’m going to rewrite it in C++, I didn’t take the news of Microsoft depreciating framework well   :crazy2:

3
.NET / Re: AutoCAD2025 and loading dependency dll's
« Last post by MickD on May 29, 2024, 10:13:21 PM »
Maybe that’s a Framework DLL that doesn’t like Core?

huh, thanks for the heads up, I checked the install req's and:
Quote
If it’s not already installed, Microsoft .NET Framework 4.8, will also be installed with AutoCAD 2025 including Specialized Toolsets. Microsoft .NET Framework 4.8 also requires a Windows version that’s currently supported by Microsoft.

Then did a search for AutoCAD dependencies and found: ( https://help.autodesk.com/view/OARX/2025/ENU/?guid=GUID-450FD531-B6F6-4BAE-9A8C-8230AAC48CB4 )
Quote
If you are targeting AutoCAD 2025 or AutoCAD 2025-based programs, you should use:

Microsoft Visual Studio 2022 version 17.8.0
Microsoft .NET 8.0

Ok, but then:
Quote
Note: Applications compiled with Microsoft Visual Studio 2019 version 16.0 or later should load into AutoCAD 2025 or AutoCAD 2025-based programs without any problems.

Anyway, thanks again for the nudge, I'll try it with .Net 8 and see how that goes, cheers.
4
.NET / Re: AutoCAD2025 and loading dependency dll's
« Last post by It's Alive! on May 29, 2024, 09:51:51 PM »
Maybe that’s a Framework DLL that doesn’t like Core?

 
5
.NET / AutoCAD2025 and loading dependency dll's
« Last post by MickD on May 29, 2024, 09:19:50 PM »
A user alerted me to a problem loading my application in AutoCAD 2025, after installing AutoCAD 2025 and running the debugger I'm getting the same error and digging deeper in inner exceptions I get:

Code: [Select]
"Unable to load DLL 'mscorwks.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)"
This has been working fine and works in the latest BricsCAD without issue. The dll referenced in is a supporting .net dll for my plugin and is used for both BricsCAD and AutoCAD builds and is independent of either platform (i.e. no ref's to CAD).

I've tried setting trusted folders and downrating security, running acad as admin etc, are there any other new security features in AutoCAD 2025 I might be missing? The dll definitely exists on my machine and AutoCAD loads the .Net framework if it's not installed so I have no clue why it can't find/load it.

Has anyone else had trouble loading dependencies of your plugin's dlls with the new AutoCAD?

UPDATE:
copying the dll into my plugin's folder works, this is not right though IMO, and why has this problem just started now??

6
AutoLISP (Vanilla / Visual) / Lisp to count text in drawing
« Last post by Mjf1999 on May 29, 2024, 09:15:52 AM »
Hello

I saw the below lisp by Tharwat Al Choufi, it works very well, but it counts all the texts, can it be modified to find/search for a specific text or part of a text (i.e. GL1A or GL1A*)

The link for the lisp is
https://www.theswamp.org/index.php?topic=57209.msg607461#msg607461


Thank you



(defun c:Test (/ s i e l g p b c r)
  ;; Tharwat Al Choufi - Date : 13.Dec.2021     ;;
  (and (setq s (ssget "_X" '((0 . "TEXT,MTEXT"))))
       (repeat (setq i (sslength s))
         (setq i (1- i)
               e (entget (ssname s i))
               l (list (cdr (assoc 1 e)) (cdr (assoc 8 e)))
         )
         (or (and (vl-some (function (lambda (q)
                                       (and (= (car q) (car l))
                                            (= (cadr q) (cadr l))
                                            (setq r q)
                                       )
                                     )
                           )
                           g
                  )
                  (setq g (vl-remove r g)
                        g (cons (append l (list (1+ (caddr r)))) g)
                  )
             )
             (setq g (cons (append l (list 1)) g))
         )
       )
       (setq p (getpoint "\nTable insertion point :"))
       (setq r 1
             b (vla-addtable
                 (vla-get-block
                   (vla-get-activelayout
                     (vla-get-activedocument (vlax-get-acad-object))
                   )
                 )
                 (vlax-3d-point p)
                 (+ 2 (length g))
                 3
                 635
                 3100
               )
       )
       (progn
         (vla-put-RegenerateTableSuppressed b :vlax-true)
         (vla-setcolumnwidth b 2 1300)
         (mapcar '(lambda (r_ c_ s_)
                    (set:text_ b r_ c_ 350 s_)
                  )
                 '(0 1 1 1)
                 '(0 0 1 2)
                 '("STRING COUNT" "String" "Layer" "QTY")
         )
         (foreach s (vl-sort g '(lambda (j k) (< (cadr j) (cadr k))))
           (setq r (1+ r))
           (mapcar '(lambda (c s) (set:text_ b r c 300 s))
                   '(0 1 2)
                   s
           )
         )
         (vla-put-RegenerateTableSuppressed b :vlax-false)
       )
  )
  (princ)
)
(vl-load-com)
;;                              ;;
(defun set:text_ (obj row col hgt str)
  (vla-settext obj row col str)
  (vla-setcelltextheight obj row col hgt)
  (vla-setcellalignment obj row col acmiddlecenter)
)
 
7
Thanks Al, sorry for late reply.. was on the beach all weekend. Works great, I could always filter the midpoints if I wanted to.
8
Nice find!
I was going to say to reverse the polyline and check the paramatpoint again, but the code you found seems to work great.
9
I'm eyeing this:

http://www.theswamp.org/index.php?topic=28438.msg477376#msg477376

I think I've found the answer.
10
Thanks.

Yes, your code helps if I want to find the intersection point(s). Note: I also have that code and use it often for other purposes but my questions is how can I find its stations/distance from the beginning of polyline. My Task: I need to mark the stations on a profile and my code will only provide the shortest station only.

Here is some code to get a list of intersections.
These are the locations you need to add the extra number.
Hope it's helpful!
Code - Auto/Visual Lisp: [Select]
  1. ;|
  2. ; Get Intersections - dexus
  3. ; Returns a list of intersecting points in a polyline
  4. ; @Param poly Ename or vla-object of polyline
  5. ; @Returns List of intersecting points
  6. |;
  7. (defun getIntersections (poly / cords)
  8.   (if
  9.     (and
  10.       (setq poly ; Get (list ename vla-object) of selected object
  11.         (cond
  12.            ((= (type poly) 'vla-object) (list (vlax-vla-object->ename poly) poly))
  13.            ((= (type poly) 'ename) (list poly (vlax-ename->vla-object poly)))
  14.         )
  15.       )
  16.       (vl-position (cdr (assoc 0 (entget (car poly)))) '("POLYLINE" "LWPOLYLINE"))
  17.       (setq cords (getcoords (car poly)))
  18.     )
  19.     (vl-remove-if ; Return list of intersections
  20.       (function (lambda (i) (vl-member-if (function (lambda (cord) (equal cord i 1e-9))) cords))) ; Remove coordinates (vertices)
  21.       (LM:group-n (gc:VariantToLispData (vla-intersectwith (cadr poly) (cadr poly) acExtendNone)) 3) ; Get all intersections
  22.     )
  23.   )
  24. )
  25.  
  26. ;; CAB 08/25/06 - revised 07.25.07
  27. ;; get pline vertex list for any
  28. (defun getcoords (ent / endp idx pt result)
  29.   (setq idx 0
  30.         endp (vlax-curve-getEndParam ent))
  31.   (while (< (setq idx (1+ idx)) endp)
  32.     (setq pt (vlax-curve-getpointatparam ent idx)
  33.           result (cons pt result))
  34.   )
  35.   (reverse (cons (vlax-curve-getendpoint ent) result))
  36. )
  37.  
  38. ;; gc:VariantToLispData - gile
  39. ;; Converts a variant or a safearray into an AutoLISP data
  40. ;; input var = variant or safearray
  41. (defun gc:VariantToLispData (var)
  42.   (cond
  43.     ((= (type var) 'variant)
  44.       (gc:VariantToLispData (vlax-variant-value var)))
  45.     ((= (type var) 'safearray)
  46.       (if (< -1 (vlax-safearray-get-u-bound var 1))
  47.         (mapcar 'gc:VariantToLispData (vlax-safearray->list var))
  48.       )
  49.     )
  50.     (t var)
  51.   )
  52. )
  53.  
  54. ;; Group by Number  -  Lee Mac
  55. ;; Groups a list 'l' into a list of lists, each of length 'n'
  56. (defun LM:group-n ( l n / r )
  57.     (if l
  58.         (cons
  59.             (reverse (repeat n (setq r (cons (car l) r) l (cdr l)) r))
  60.             (LM:group-n l n)
  61.         )
  62.     )
  63. )
Pages: [1] 2 3 ... 10