weight calculation lisp working in autocad 2014 but not working in 2016

weight calculation lisp working in autocad 2014 but not working in 2016

Anonymous
Not applicable
903 Views
2 Replies
Message 1 of 3

weight calculation lisp working in autocad 2014 but not working in 2016

Anonymous
Not applicable

Hi, I have this lisp routine that used to work in autocad 2014 but is acting up in version 2016.

It is used to calculate the weight of a wall (concrete) with an opening. (2d)

 

(defun c:gewicht ()
  (progn
    (SETQ dikte (GETREAL "\ndikte van het paneel?: (m) "))
    (setq DZIN (getvar "dimzin"))
    (setq ins 1)

    (while
      (setq ins (getpoint "\nPick Number Location: "))
       (command "dimzin" "0")
       (command "-hatch" ins "")
       (command "area" "o" "l")
       (command "erase" "l" "")
       (setq AR (getvar "area"))
       (setq
     gewicht (strcat (rtos (* (getvar "area") dikte 0.2450) 2 2)
             "  kg"
         )
       )
       (command "mtext" ins "h" 15 "j" "mc" ins gewicht "" "")
       (command "dimzin" DZIN)
    )                    ;WHILE
    (princ)
  )
)

 

 

So what is it doing wrong?

The 2014 version it would create a hatch based on island detection.

It would get the area from the last created element (hatch) calculate the weight.

Add the text

Delete the hatch.

 

version 2016: adds the hatch, but only calculates the weight of the island.

Deletes not only the hatch but the original drawing too.

 

So version 2014 would give me a weight of 8000+kg (20cm think concrete wall (0.2m)

Version 2016 only 2000+kg

 

Can someone help me find out what i did wrong?

0 Likes
904 Views
2 Replies
Replies (2)
Message 2 of 3

Ajilal.Vijayan
Advisor
Advisor

As this lisp routine is using acad hatch to calcualte the area, make sure the Hatch settings is detecting the island.

Spoiler
Capture.JPG
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thank you, But it seems that it was a problem with annotative hatch i changed my code to: (command "-hatch" "an" "n" ins "") and now it is working again.
0 Likes