C: TEST function in 1 drawing only

C: TEST function in 1 drawing only

iBlachu
Advocate Advocate
400 Views
5 Replies
Message 1 of 6

C: TEST function in 1 drawing only

iBlachu
Advocate
Advocate

Hi,

 

How do I force my LISP function (eg C: TEST) to be defined only in the drawing in which I load it from the file?

0 Likes
401 Views
5 Replies
Replies (5)
Message 2 of 6

martti.halminen
Collaborator
Collaborator

That is the standard behaviour of LOAD.

(unless you have that called somewhere where it gets called for each drawing.)

Message 3 of 6

iBlachu
Advocate
Advocate

The problem is that when I load the LISP file (load "c: /test.lsp") and the file defines the following function:

 

(defun C:TEST() (alert "TEST:))

 

it is actually possible to use in the current drawing.

 

But the problem is that in other figures the abbreviation TEST (resulting from C: TEST) will be defined but without the function body (it won't work).

So how do you prevent C: TEST from being created in other drawings?

 

0 Likes
Message 4 of 6

Kent1Cooper
Consultant
Consultant

@iBlachu wrote:

.... the problem is that in other figures the abbreviation TEST (resulting from C: TEST) will be defined but without the function body (it won't work).

So how do you prevent C: TEST from being created in other drawings?


It sounds, from your description, as though C:TEST is, in fact, not being created in other drawings, which is as desired, so what's the problem really?  [Doing likewise, if I include the missing closing quotation mark, does not create it in other drawings for me.]  But I confess I don't really understand what you mean by the red part above.

Kent Cooper, AIA
0 Likes
Message 5 of 6

diagodose2009
Collaborator
Collaborator

You break the program "C:TEST.Lsp" into two pieces.

a)first. the main -programe name "pp_circle32pat_jc18lda.lsp"

b)second. You create the installer.lisp. If you hide the programe installer.lisp from other

  user/s  then anyone cannot run the "pp_circle32pat_jc18lda.lsp" outside the yourDrawing.dwg

The nickname for installer.lisp is "asm_lhc18lda.VLX"

But remember. if you wish and  run the application "pp_circle32pat_jc18lda.lsp",before,

   you must save the yourDrawing.dwg after you execute  "asm_lhc18lda.VLX".

 

If you want, saw the full-source of , you see the pp_circle32pat_jc12cws.lsp

The programe source-ascii.txt  named
"pp_circle32pat_jc18lda.lsp"
is total-blocked , you cannot execute
"pp_circle32pat_jc18lda.lsp" without
asm_lhc18lda.VLX
** After you save yourDrawing.dwg, 
you can execute "pp_circle32pat_jc18lda.lsp"
anytime inside yourDrawing.dwg, but you do not execute in other Drawing.dwg

 

 

 

 

Message 6 of 6

diagodose2009
Collaborator
Collaborator

The  youDrawing.dwg must contain 3...10 x circles inside ModelSpace.

For this demo, I work 11hours, fixing the Error?s, but this demo, can be extended with Other.lisp