VVallerga 发表于 2022-7-5 23:05:48

LISP worked in 2012, but not f

Hopefully someone can help me.The LISP in question was already created when I started at my company 8 years and I have no idea how to read/create them.Of course that person is no longer here and nobody else has any knowledge of LISPs.
 
It allows you to measure a distance using multiple points, rounds the value up to the nearest 10, inserts a specific block and enters the measurement into the attribute field. In 2012 and all the way back to 2007 it worked as it is supposed to.It works as it always has until the end, in 2014 it brings up the 'enter attributes' window.I have attached our block we use and the LISP is below.
 
Thank you for any help anyone can provide.
 
Victor
 

(defun c:WW () (setq   PT01    (getpoint "\Start Point: ")   CALC010   SCALE01 (getvar "dimscale") ) (while   (setq PT02 (getpoint PT01 "\nNext Point:"))    (if PT02      (setq DIST01 (distance PT01 PT02)   CALC02 (+ DIST01 CALC01)   CALC01 CALC02   PT01   PT02   CALC03 (* 10 (+ 1 (fix (/ (fix CALC01) 10))))      )    ) ) (setq PT03 (getpoint "\nInsertion Point ")) (if PT03   (command "insert" "Block-Ftg-WW.dwg" PT03 SCALE01 SCALE01 pause CALC03) ) (setq CALC03 0) (princ "\n   WW FOOTAGE COMPLETE") (princ))
Block-Ftg-WW.dwg

BIGAL 发表于 2022-7-5 23:19:03

Its probably the "insert" like this it will pop the dialouge box try the "_insert" I think Lee-mac on his web site has description about ._command _command etc.

meracl 发表于 2022-7-5 23:25:13

I had the same issue with one of my lisps.
Set ATTDIA system variable to 0

Tharwat 发表于 2022-7-5 23:37:47

This ... ?
 

(defun c:test (/ *error* d p 1p s f v) ;;    Tharwat 06.May.2014      ;; (defun *error* (x)   (if v   (mapcar 'setvar '(attreq attdia) v)   )   (princ) ) (cond ((and (not (tblsearch "BLOCK" (setq f "Block-Ftg-WW"))) (not (setq f (findfile "Block-Ftg-WW.dwg"))))      (alert "Can not find Drawing < Block-Ftg-WW.dwg > !!")       )       ((setq d 0.            p (getpoint "\n Specify Point: ")      )       ) ) (if p   (while (setq 1p (getpoint p "\n Next Point :"))   (setq d (+ d (distance p 1p))         p 1p   )   ) ) (if (and d (setq p (getpoint "\n Insertion Point ")))   (progn (setq v (mapcar 'getvar '(attreq attdia)))          (mapcar 'setvar '(attreq attdia) '(1 0))          (command "_.-insert"                   f                   "_none"                   p                   (setq s (getvar 'DIMSCALE))                   s                   pause                   (rtos (* 10 (+ 1 (fix (/ (fix d) 10)))) 2)          )    ) ) (*error* nil) (princ))

VVallerga 发表于 2022-7-5 23:44:32

meracl - That was the ticket.Thank you very much.That saved us a lot of headaches.
 
Tharwat and BIGAL - Thank you for your help too.

Tharwat 发表于 2022-7-5 23:51:23

You're welcome .
 
And hope the routine running as needed .

SLW210 发表于 2022-7-6 00:02:42

Please read the Code Posting Guidelines and use Code Tags for your Code. I fixed your original post for you this time.

meracl 发表于 2022-7-6 00:06:35

You are welcome.
Im glad that, solved your problem.
页: [1]
查看完整版本: LISP worked in 2012, but not f