Make this lisp work in Autocad LT

Make this lisp work in Autocad LT

DC-MWA
Collaborator Collaborator
615 Views
9 Replies
Message 1 of 10

Make this lisp work in Autocad LT

DC-MWA
Collaborator
Collaborator

Hello,

I have this little "franken-lisp" i have been using. We are moving to autocad LT and the vlax function are not supported.

I'm hoping someone can assist me making something similar that will work with LT. 

 

0 Likes
616 Views
9 Replies
Replies (9)
Message 2 of 10

cadffm
Consultant
Consultant

Hi,

 

>>"the vlax function are not supported"

Which one?

Sebastian

0 Likes
Message 3 of 10

cadffm
Consultant
Consultant

@cadffm  schrieb:

>>"the vlax function are not supported"

Which one?


There are two, both are supported. Test your lisp in a new file with rectangles made by command rectang.

Sebastian

0 Likes
Message 4 of 10

paullimapa
Mentor
Mentor

All @cadffm has to do is wave his magic wand and now that lisp works in LT...give it a try.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 10

pendean
Community Legend
Community Legend

@DC-MWA Your LISP works just fine in LT2024 and LT2025: earlier LT versions did not have LISP.

 

BUT... it does not seem to work if your rectangles are small (returns a zero or 1).

Is that what you are seeing perhaps?

0 Likes
Message 6 of 10

DC-MWA
Collaborator
Collaborator

Not sure why it was not working. I looked it up and oracle told me the vlax was not supported. So my limited lisp self assumed. Shame on me.

Thank you all for your assist and wisdom.

 

0 Likes
Message 7 of 10

cadffm
Consultant
Consultant

For other lisps, if they not working after ACAD restart, tried in another file:

 

Check the lisp content for 

read this (and for more informations, follow the link in my post)

https://forums.autodesk.com/t5/autocad-lt-forum/attout-attin-equivalent-for-lt/td-p/12587077

 

 

Sebastian

0 Likes
Message 8 of 10

ec-cad
Collaborator
Collaborator

Here's an old method that should work in LT for getting Area.

Uses (command ".area" O ent) to set system variable 'Area (for entity 'ent)

Give it a try. I'm not sure why your original code prompts for selecting polylines to 

(subtract), but code shows addition ? Anyway, change as desired.

Cheers

 

ECCAD

(defun C:SubArea ( )
  (vl-load-com)
;; Select Outer Polyline for Area
  (setq pl1 (car (entsel "\nSelect Outer Polyline for Area:")))
  (if pl1
   (progn
    (redraw pl1)
    (command ".area" "O" pl1); set var 'area to this area
    (setq pl1_area (/ (getvar "area") 144)); Area in Sq. Ft.
    (if pl1_area
     (progn
      (setq subA 0 I 0)
       (princ "\n<<<< Select Objects to Subtract >>>>")
       (setq plS (ssget)); Select Objects to Subtract
       (repeat (sslength plS)
        (setq plx (ssname plS I)); each item
        (setq etype (cdr (assoc 0 (entget plx))))
         (if (= etype "LWPOLYLINE")
          (progn
           (command ".area" "O" plx)
           (setq subA (+ subA (/ (getvar "area") 144)))
          ); progn
         ); if
         (setq I (+ I 1))
        ); repeat
        (if (> subA 0.0)
         (progn
          (setq TotA (- pl1_area subA)); Subtract Areas from Outer Polyline
          (setq str (rtos TotA 2 2))
          (alert (strcat "\nTotal Area: " str " SF"))
         ); progn
        ); if
      ); progn
     ); if
    ); progn
   ); if
   (princ)
 ); function
 (princ)
0 Likes
Message 9 of 10

cadffm
Consultant
Consultant

Hi ,

 

"

 that should work in LT for getting Area.

Uses (command"

OLD LT (v2023 or older) = NO LISP or othe API

 

Since 2024, Lisp is available and the lisp above works.

Sebastian

0 Likes
Message 10 of 10

ec-cad
Collaborator
Collaborator

Should have said "that should work in 2024LT or 2025LT that support Lisp, for getting Area.

My bad.

ECCAD

0 Likes