I must confess Maverick, I am confused. How do you expect to run a LISP
routine from a VBA form? Also, when you say your globals have disappeared,
are yousaying your layers (along with the other public objects) are empty?
"Maverick" wrote in message
news:8764ar$ia66@adesknews2.autodesk.com...
> Ok: This is some code:
>
> Public Layer_Terreno As AcadLayer
> Public Layer_Sostegni As AcadLayer
> Public Layer_Altro As AcadLayer
> Public Layer_Vincoli As AcadLayer
> Public Layer_Franco As AcadLayer
> Public Layer_Righello As AcadLayer
> Public PI As Double
>
> Public Hatch_Solido As AcadHatch
>
> Public FrontView As AcadViewport
> Public TopView As AcadViewport
>
> Public Fondamentale As Double
>
> Public KX As Single
> Public KY As Single
>
> Public isFile as boolean
> Public actPath as string
>
> Private Sub AcadDocument_Activate()
>
> actPath = "m:\marco\enel3d"
>
> KX = 1
> KZ = 1
>
> IsFile = False
>
> ThisDrawing.SetVariable "CURSORSIZE", 100
> PI = 4 * Atn(1)
>
> Set Hatch_Solido = ThisDrawing.ModelSpace.AddHatch _
> (acHatchPatternTypePreDefined, "ANSI31", True)
>
> Set Layer_Terreno = ThisDrawing.Layers.Add("Terreno")
> Layer_Terreno.Color = acGreen
> Set Layer_Sostegni = ThisDrawing.Layers.Add("Sostegni")
> Layer_Sostegni.Color = acWhite
> Set Layer_Vincoli = ThisDrawing.Layers.Add("Vincoli")
> Layer_Vincoli.Color = acRed
> Set Layer_Altro = ThisDrawing.Layers.Add("Altro")
> Layer_Altro.Color = acYellow
> Set Layer_Franco = ThisDrawing.Layers.Add("Franco")
> Layer_Franco.Color = acBlue
> Set Layer_Righello = ThisDrawing.Layers.Add("Righello")
> Layer_Righello.Color = acGreen
>
> end sub
>
> This routine, set my variables when the acad is start.
> subsequently, from the menù the user click on this routine:
>
> sub Mmodifica()
>
> frm_Modifica_Sostegno.show ' It's a Form
>
> end sub
>
> The form called have a button that call a visual lisp routine:
>
> (defun c:disdima (/)
> (... this function draw a matematical function tracking the mouse ...)
>
>
> (command "_-vbarun")
> (command "Getcoord")
> )
>
> When the lisp function ends call a Vba routine that read the coordinates
> from a file... but when I'm return in VBA the global variables are all
> disappeard (This thing also happen when an error occur and I click on the
> end button!).
>
> Have you need of other information?
>
>
>