Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

acNative Symbol Error

9 REPLIES 9
Reply
Message 1 of 10
mgorecki
312 Views, 9 Replies

acNative Symbol Error

I'm updating one of my old programs and while testing I get a pop-up with the following:

Assignment to protected symbol:  asNative

Enter break loop?

 

If I pick "No" it allows me to run the program.  If I pick "Yes" it gives me the following:

User warning: assignment to protected symbol: acNative <- 48

 

I've looked around, some say I may have used a variable name that is an AutoCad variable.  If that's true, how can I find it.  The program is pretty long.

 

Thanks

9 REPLIES 9
Message 2 of 10
Shneuph
in reply to: mgorecki

Command: LSP

Initializing...
Enter an option [?/Commands/Functions/Variables/Load]: LSP

Invalid option keyword.

Enter an option [?/Commands/Functions/Variables/Load]: v

Enter Variables to list <*>: acN*

ACNATIVE                      (INT)                         Com
ACNODRAWINGAREASHORTCUTMENU   (INT)
ACNONECONTENT                 (INT)
ACNONECREASE                  (INT)
ACNOOVERRIDES                 (INT)
ACNORM                        (INT)                         Com
ACNORMAL                      (INT)
ACNOTSTACKED                  (INT)                         Com
ACNOUNITS                     (INT)
ACNURBSURFACE                 (INT)

 It does look like a  native autocad variable.  You can open your .lsp program in notepad and press Ctrl+H to find and replace the variable with another name.

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 3 of 10
Lee_Mac
in reply to: mgorecki

acnative is an enumeration for the ActiveX saveas method corresponding to the latest available drawing version.

 

The error you are receiving would indicate that there is an AutoLISP expression (e.g. setq / set) which is attempting to redefine this protected symbol. This may not necessarily be the fault of your own code, as there are known cases of Express Tools' code attempting to redefine protected symbols (along with the many other bugs in the Express Tools).

 

You can avoid the popup by changing the 'SETQ to protected symbols' setting within the VLIDE (under Tools > Environment Options > General Options) to 'Transparent' - though, note that this will only ignore the underlying problem and not resolve it.

Message 4 of 10
mgorecki
in reply to: Lee_Mac

Hello Lee,

I do have a "saveas" command in my code:

(command "saveas" "2000" savename )

 

What's weird is that this code is a couple of years old and it's just now giving me this pop-up.

 

Thanks,

Mark

Message 5 of 10
dbroad
in reply to: mgorecki

If by chance those responses don't help you modify your lisp, then use vlide and use the find/replace functionality to replace acnative with another symbol.  But be careful if you are using it as intended at certain locations (within vla-saveas for example) since you wouldn't want to disable that behavior.  If your lisp is long, add comments to your changes (at least noting the date and reason).

The notice will only come up with vlide running I believe and only in recent versions of AutoCAD.

Architect, Registered NC, VA, SC, & GA.
Message 6 of 10
mgorecki
in reply to: dbroad

I searched my code for "acnative" and it's not in there.

The part where I save the drawing is just:

 ;Save the new drawing
 (setq savename (getfiled "Save As" dwg_number "dwg" 1)) ;Will check if file exists
 (vl-file-delete savename) ;deletes the file from the selected folder
 (command "saveas" "2000" savename ) ; saves the drawing to the selected folder

 

Message 7 of 10
dbroad
in reply to: mgorecki

Before you give up, open up any supplemental file that is loaded as the main file is loaded and check there as well.  Search for "(load".  Then open the files.

 

Setting break on error in vlide can also assist with debugging but only when the files are all opened in vlide.

Architect, Registered NC, VA, SC, & GA.
Message 8 of 10
mgorecki
in reply to: dbroad

This is pretty much the only file, programwise.  It reads a text file to get the variable values, and it creates a text file.  I set the "break on error", but it didn't show me anything.  The pop-up just popped up again as usual.

I don't have a "(load" command in my code either.

 

Thanks for taking the time to help me out.

 

Message 9 of 10
mgorecki
in reply to: mgorecki

Ok, I have it narrowed down to a small piece of code that goes into all our LiSP programs.  It's a license section that only allows the program to be run on our network.  Though I don't know why it's acting up now, the "license" hasn't changed since 2003.

 

Ok thank you all for your help.  I think I'll just set the "ignore" setting you suggested since it's not my code that's causing the issue.

 

Best regards,

Mark

Message 10 of 10
dbroad
in reply to: mgorecki

Treat this merely as a suggestion.  While you are aware of the problem, notify whoever is responsible for the problem to ask them to fix it.  In the future, if someone ever wrote a program on your network that used the reserved symbol for a vla-save as intended, there would be other errors beyond this warning.  Those other errors might be hidden because you turned off the warning notification.  Programming with the warning notice system disabled could also lead to other hidden errors.

Architect, Registered NC, VA, SC, & GA.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost