TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: commodore on January 13, 2009, 10:03:21 AM

Title: Assignment to protected symbol error and AecXBase lib
Post by: commodore on January 13, 2009, 10:03:21 AM
Is there something wrong with my code or with the AecXBase.tlb library that when I run this I immediately get 2 "Assigment to protected symbol:" errors on "paec-get-linewieght" and "paec-put-lineweight"
It does not matter what prefix I try.
I am using MEP2008
Anyone else care to try and tell me their results?

Code: [Select]
(vlax-Import-Type-Library
:tlb-filename "AecXBase.tlb"
:methods-prefix "maec-"
:properties-prefix "paec-"
:constants-prefix "caec-"
)
Title: Re: Assignment to protected symbol error and AecXBase lib
Post by: Matt__W on January 13, 2009, 10:09:38 AM
Also using MEP 2008...

Quote
Command: (vlax-Import-Type-Library :tlb-filename "AecXBase.tlb":methods-prefix "maec-":properties-prefix "paec-":constants prefix "caec-")
T

I dunno... :|
Title: Re: Assignment to protected symbol error and AecXBase lib
Post by: Spike Wilbury on January 13, 2009, 10:15:06 AM
Maybe this can be of some use:

http://www.theswamp.org/index.php?topic=9441.msg132792#msg132792
Title: Re: Assignment to protected symbol error and AecXBase lib
Post by: commodore on January 13, 2009, 02:50:48 PM
I guess I should add MEP SP1
Whats the date on your AecXBase.tlb file?
Mines 9/7/2007 9:17 AM

Also using MEP 2008...

Quote
Command: (vlax-Import-Type-Library :tlb-filename "AecXBase.tlb":methods-prefix "maec-":properties-prefix "paec-":constants prefix "caec-")
T

I dunno... :|
Title: Re: Assignment to protected symbol error and AecXBase lib
Post by: commodore on January 14, 2009, 08:07:52 AM
Load the Vlide and try again
It seems that this is what causes the problem on my end.
If I dont start the vlide it runs fine.

Also using MEP 2008...

Quote
Command: (vlax-Import-Type-Library :tlb-filename "AecXBase.tlb":methods-prefix "maec-":properties-prefix "paec-":constants prefix "caec-")
T

I dunno... :|
Title: Re: Assignment to protected symbol error and AecXBase lib
Post by: Keith™ on January 14, 2009, 08:51:26 AM
Yeah vlide and protected var assignment is flaky .. heck even the Autodesk expresstools in previous versions wouldn't load properly if the vlide was open.
Title: Re: Assignment to protected symbol error and AecXBase lib
Post by: Spike Wilbury on January 14, 2009, 10:14:26 AM
Did you tried with this:

Code: [Select]
(pragma '((unprotect-assign paec-get-linewieght paec-put-lineweight)))

(vlax-Import-Type-Library
:tlb-filename "AecXBase.tlb"
:methods-prefix "maec-"
:properties-prefix "paec-"
:constants-prefix "caec-")

(pragma '((protect-assign paec-get-linewieght paec-put-lineweight)))

As in my previous post ?
Title: Re: Assignment to protected symbol error and AecXBase lib
Post by: commodore on January 14, 2009, 01:18:39 PM
At first no, but now I have and the result is the same error.
What is pragma? I cant find any documentation on this.

Did you tried with this:

Code: [Select]
(pragma '((unprotect-assign paec-get-linewieght paec-put-lineweight)))

(vlax-Import-Type-Library
:tlb-filename "AecXBase.tlb"
:methods-prefix "maec-"
:properties-prefix "paec-"
:constants-prefix "caec-")

(pragma '((protect-assign paec-get-linewieght paec-put-lineweight)))

As in my previous post ?
Title: Re: Assignment to protected symbol error and AecXBase lib
Post by: commodore on January 14, 2009, 01:20:55 PM
Its not even if the vlide is open. Its if the vlide HAS been OPENED.
Even if I close the vlide I get the error.

Yeah vlide and protected var assignment is flaky .. heck even the Autodesk expresstools in previous versions wouldn't load properly if the vlide was open.
Title: Re: Assignment to protected symbol error and AecXBase lib
Post by: Matt__W on January 14, 2009, 01:28:15 PM
I guess I should add MEP SP1
Whats the date on your AecXBase.tlb file?
Mines 9/7/2007 9:17 AM
Same!   :|
Title: Re: Assignment to protected symbol error and AecXBase lib
Post by: Keith™ on January 14, 2009, 01:32:45 PM
Its not even if the vlide is open. Its if the vlide HAS been OPENED.
Even if I close the vlide I get the error.

Yeah vlide and protected var assignment is flaky .. heck even the Autodesk expresstools in previous versions wouldn't load properly if the vlide was open.

That is correct, because the error trap from the VLIDE stays resident even after the VLIDE is closed.

You can change the notification by selecting Tools-->Environment Options-->General Options [General Tab] (in the VLIDE)

There is an option for "SETQ to protected symbols" .. if you set it to transparent, the error notification goes away
Title: Re: Assignment to protected symbol error and AecXBase lib
Post by: commodore on January 15, 2009, 06:36:15 AM
Thanks for all the info!