LT2024 Lisp help - How to link a "text" to the "save function"

LT2024 Lisp help - How to link a "text" to the "save function"

cad1Q2LPX
Observer Observer
336 Views
1 Reply
Message 1 of 2

LT2024 Lisp help - How to link a "text" to the "save function"

cad1Q2LPX
Observer
Observer

Hi everyone, we have Autocad LT and we need to link a "text" on to a layout to the "save function", a sort of "incremental number".

I mean :

text 00 -> saved file 01/03/2024

text 02 -> saved file 02/03/2024

 

Do you have ever tryed it ? If yes, how could we do ?

 

 

 

 

 

[ The subject line of this post has been edited for clarity by @pendean Original: Mr. Lou ]

0 Likes
337 Views
1 Reply
Reply (1)
Message 2 of 2

scot-65
Advisor
Advisor

cad1q,

 

One method involves

1. Register an application and embed extended data onto a MText object (object must first exist in the file).

2. Command reactor to "sniff out" SAVE or QSAVE.

 

Hunt down the object(s) that has the extended data.

I am suggesting using MText so that one can append DFX 1 with "\P" new line.

 

;;Add extended data
(if (setq d (entsel "\nSelect text object: "))
 (progn
  (if (not (tblsearch "appid" "My_MenuApp")) (regapp "My_MenuApp"))
  (entmod (append (entget (car d)) '((-3 ("My_MenuApp" (1000 . "SaveDates"))))))
 );progn
);if

 

;;Fetch the object
(if (setq s (ssget "x" '((-3 ("My_MenuApp")))))...

 

Another method I can think of is using a multi-line attribute block (untested here).

Fetching the object involves stepping thru a list of anonymous blocks until the block is found.

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes