Author Topic: I need to PROPAGATE defuns . . .  (Read 2136 times)

0 Members and 1 Guest are viewing this topic.

domenicomaria

  • Swamp Rat
  • Posts: 725
I need to PROPAGATE defuns . . .
« on: May 25, 2021, 05:28:01 AM »
I wrote an application that uses some modeless forms of Open DCL.
Every button, has its associated defun.

I need that this modeless form,
has to work in every open DWG, in every DOC.

So I need to PROPAGATE defuns.
A lot of defuns ... ! (more then 500 defuns !)

So I tried this :

(vl-propagate 'DEFUN-NAME)

but NOTHING HAPPENS !

I need to PROPAGATE a DEFUN , not a VARIABLE . . .

any suggestion ?

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: I need to PROPAGATE defuns . . .
« Reply #1 on: May 25, 2021, 06:33:20 AM »
Every button, has its associated defun.
the button defines a function or the button calls a function?

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: I need to PROPAGATE defuns . . .
« Reply #2 on: May 25, 2021, 06:41:17 AM »
the button defines a function or the button calls a function?

The defuns are defined onInitialize event.
When the form is shown.

Every button calls a function defined from a defun.

When the user clicks on that button, the associated defun is executed.

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: I need to PROPAGATE defuns . . .
« Reply #3 on: May 25, 2021, 08:59:23 AM »
the button defines a function or the button calls a function?
The defuns are defined onInitialize event.
you may try (vl-load-all) and OnDocActivate event

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: I need to PROPAGATE defuns . . .
« Reply #4 on: May 25, 2021, 09:31:18 AM »
Quote
you may try (vl-load-all) and OnDocActivate event

vl-load-all is good only the first time . . .
. . .
it is not easy to explain . . .
. . .
Defuns are redefined at run time frequently.
. . .
I cannot load all, all the time a defun is redefined . . .
. . .
When the user switches from
DIMENSIONs to TEXT UTILITIES[2]
all the 25 defuns associated to these 25 buttons,
are REDEFINED at RUN TIME.
. . .
All the time, have I to reload (all) every thing ?
. . .
Just to give you an idea, take a look to the attached images.


VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: I need to PROPAGATE defuns . . .
« Reply #5 on: May 25, 2021, 09:55:53 AM »
i see that initially you functions are strings
you can build a list of all those strings, then vl-propagate this list and then read-eval items from this list upon OnDocActivate event

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: I need to PROPAGATE defuns . . .
« Reply #6 on: May 25, 2021, 11:56:51 AM »
i see that initially you functions are strings
you can build a list of all those strings, then vl-propagate this list and then read-eval items from this list upon OnDocActivate event

thank you

i will give it a try

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: I need to PROPAGATE defuns . . .
« Reply #7 on: May 26, 2021, 10:14:28 AM »
Vovka thanks.

You always help me.

It works !

1- vl-load-all
2- an onDocActivated defun
3 - create a list of strings representing the code of all the run-time re-defined defuns
4 - vl-propagate this list of strings
5 - when the event onDocActivated happens, then mapcar, read , eval . . .

. . . if you come to Italy, I will offer you a case of beer. . .
we will drink it, you and my Ukrainian friend from Kharkiv (Харьков)

. . .

grazie

ciao
« Last Edit: May 26, 2021, 01:17:11 PM by domenicomaria »

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: I need to PROPAGATE defuns . . .
« Reply #8 on: May 26, 2021, 02:25:38 PM »
. . . if you come to Italy, I will offer you a case of beer. . .
we will drink it, you and my Ukrainian friend from Kharkiv (Харьков)
:smitten:
say 'hi' to him from Lutsk (Луцьк)

domenicomaria

  • Swamp Rat
  • Posts: 725
Re: I need to PROPAGATE defuns . . .
« Reply #9 on: May 26, 2021, 02:31:16 PM »
her

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: I need to PROPAGATE defuns . . .
« Reply #10 on: May 26, 2021, 02:42:24 PM »

ribarm

  • Gator
  • Posts: 3272
  • Marko Ribar, architect
Re: I need to PROPAGATE defuns . . .
« Reply #11 on: June 27, 2022, 11:56:44 PM »
@VovKa,
fast fingertips?
Tell us something from your IRT experiences...
Was it fun to write it?
How are your legs?
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube