Author Topic: What's this message mean?  (Read 3541 times)

0 Members and 1 Guest are viewing this topic.

HasanCAD

  • Swamp Rat
  • Posts: 1421
What's this message mean?
« on: July 29, 2015, 03:53:38 PM »
While converting block to xref using blocktoxref this message comes.

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: What's this message mean?
« Reply #1 on: July 29, 2015, 04:04:23 PM »
>>LINK<<
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: What's this message mean?
« Reply #2 on: July 29, 2015, 04:06:34 PM »
It means someone has done this:
Code - Auto/Visual Lisp: [Select]
  1. (setq gc ... )

HasanCAD

  • Swamp Rat
  • Posts: 1421
Re: What's this message mean?
« Reply #3 on: July 29, 2015, 05:06:51 PM »
It means someone has done this:
Code - Auto/Visual Lisp: [Select]
  1. (setq gc ... )
So should I do this?
Code - Auto/Visual Lisp: [Select]
  1. (setq gc nil )

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: What's this message mean?
« Reply #4 on: July 29, 2015, 05:30:53 PM »
Ahhhh, NO.  "gc" is a named function ie. (gc) so it should *never* be used as a variable name.  Unless you are certain nothing you've got actually calls that function.  And even then its just a bad idea, like doing (setq defun nil).
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: What's this message mean?
« Reply #5 on: July 29, 2015, 05:35:38 PM »
It means someone has done this:
Code - Auto/Visual Lisp: [Select]
  1. (setq gc ... )
So should I do this?
Code - Auto/Visual Lisp: [Select]
  1. (setq gc nil )

Definitely not - and you would receive the same error if you did; you should instead try to ascertain the source of the problem.

On a brief inspection of the code for the BLOCKTOXREF command, the issue seems to stem from the acet-blocktoxref-copy-layer-props function defined on line 233 of the blocktoxrefsup.lsp file: this function declares the symbol 'gc' as a local variable and uses this protected symbol within a foreach loop.

I would suggest replacing all occurrences of the symbol 'gc' between lines 233 & 277 with say, 'gcc' (or any unprotected symbol which hasn't already been used).

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: What's this message mean?
« Reply #6 on: July 29, 2015, 09:39:30 PM »
If you are not if it's a Function or Command or Variable try the command LSP
This only works for globally assigned Symbols ie will not recognise variables or methods local to a function.


Command: LSP
Initializing...
Enter an option [?/Commands/Functions/Variables/Load]: c
Enter Commands to list <*>: g*
GATTE                         (SUBR)
GETSEL                        (SUBR)
GIFIN                         (SUBR)
GOTOURL                       (SUBR)
Command:
Command: LSP
Enter an option [?/Commands/Functions/Variables/Load]: v
Enter Variables to list <*>: g*
GVAR:REACTORPREVLAYER         (STR)
Command:
Command: LSP
Enter an option [?/Commands/Functions/Variables/Load]: f
Enter Functions to list <*>: g*
GC                            (SUBR)                        Core
GCD                           (SUBR)                        Core
GET_ATTR                      (SUBR)                        Core
GET_TILE                      (SUBR)                        Core
GETANGLE                      (SUBR)                        Core
GETATOMS                      (SUBR)
GETATTRIBUTES                 (SUBR)
GETCFG                        (SUBR)                        Core
GETCNAME                      (SUBR)                        Core
GETCORNER                     (SUBR)                        Core
GETDIST                       (SUBR)                        Core
GETENV                        (SUBR)                        Core
GETFILED                      (SUBR)                        Core
GETINT                        (SUBR)                        Core
GETKWORD                      (SUBR)                        Core
GETORIENT                     (SUBR)                        Core
GETPOINT                      (SUBR)                        Core
GETPROPERTYVALUE              (EXRXSUBR)
GETREAL                       (SUBR)                        Core
GETSTRING                     (SUBR)                        Core
GETURL                        (EXRXSUBR)                    Core
GETVAR                        (SUBR)                        Core
GRAPHSCR                      (SUBR)                        Core
GRCLEAR                       (SUBR)                        Core
GRDRAW                        (SUBR)                        Core
GRREAD                        (SUBR)                        Core
GRTEXT                        (SUBR)                        Core
GRVECS                        (SUBR)                        Core
Command:



Also note that symbols can be assigned 'protected' from code.
;; if you answer NO to 'enter break loop'
;; the value of the protected symbol theNumber will be redefined.
;; Enter YES to 'enter break loop' for the value to be retained.

I use this a lot for a warning regarding symbols I don't want to be casually overwritten.
Note that the Symbol names will turn blue in the Vlide after protection.

Code - Auto/Visual Lisp: [Select]
  1. ;; protect-assign sample : kdub 2015/07/30
  2.  
  3. (eval (list 'pragma (list 'quote (list (cons 'unprotect-assign (list 'Function01 'Function02 'theNumber))))))
  4.  
  5. (defun Function01 ()
  6.   (alert "This is Function 01")
  7.   (princ)
  8. )
  9.  
  10. (defun Function02 ()
  11.   (alert "This is Function 02")
  12.   (princ)
  13. )
  14.  
  15. (setq theNumber 42)
  16.  
  17.  
  18. (eval (list 'pragma (list 'quote (list (cons 'protect-assign (list 'Function01 'Function02 'theNumber))))))
  19.  
  20. ;;=============================================================
  21.  
  22. ;; NOTE : if you answer NO to 'enter break loop'
  23. ;; the value of the protected symbol theNumber will be redefined.
  24. ;; Enter YES to 'enter break loop' for the value to be retained.
  25. (setq theNumber 44)
  26.  
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: What's this message mean?
« Reply #7 on: July 30, 2015, 04:06:13 AM »
Code - Auto/Visual Lisp: [Select]
  1. (eval (list 'pragma (list 'quote (list (cons 'unprotect-assign (list 'Function01 'Function02 'theNumber))))))

This seems unnecessarily complicated; why not the following?:
Code - Auto/Visual Lisp: [Select]
  1. (pragma '((unprotect-assign Function01 Function02 theNumber)))

(similarly for 'protect-assign')

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: What's this message mean?
« Reply #8 on: July 30, 2015, 05:03:53 AM »

Yes Lee, that will work in the instance shown. I just cut the names in for the sample rther than use a list of names as I usually do.

I allocate the function names and vars to a list of quoted names

This would be more slightly economical .. use a quoted list of names.
Code - Auto/Visual Lisp: [Select]
  1. (setq funs '(Function01 Function02 theNumber Function03 Function04 Function04 Function06 Function07 Function08 ;; etc etc))
  2.  
  3. (eval (list 'pragma (list 'quote (list (cons 'unprotect-assign funs)))))
  4.  
  5.  
  6. ;; define / declare stuff here
  7.  
  8.  
  9. (eval (list 'pragma (list 'quote (list (cons 'protect-assign funs)))))
  10.  
  11. (setq funs nil)

That methodology is essentially unchanged by me since Release R14 with VitalLisp by Basis Software (before AutoDesk purchased and modified the Software and renamed it VisualLisp )
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: What's this message mean?
« Reply #9 on: July 30, 2015, 05:30:34 AM »
Without wanting to labour the point, I still don't see the need for the (eval (list 'pragma ... )) construct - even with a list of symbols, I would use:
Code - Auto/Visual Lisp: [Select]
  1. (pragma (list (cons 'unprotect-assign funs)))

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: What's this message mean?
« Reply #10 on: July 30, 2015, 05:42:56 AM »
Without wanting to labour the point, I still don't see the need for the (eval (list 'pragma ... )) construct - even with a list of symbols, I would use:
Code - Auto/Visual Lisp: [Select]
  1. (pragma (list (cons 'unprotect-assign funs)))

Did you try that Lee ??
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: What's this message mean?
« Reply #11 on: July 30, 2015, 05:54:35 AM »
Without wanting to labour the point, I still don't see the need for the (eval (list 'pragma ... )) construct - even with a list of symbols, I would use:
Code - Auto/Visual Lisp: [Select]
  1. (pragma (list (cons 'unprotect-assign funs)))

Did you try that Lee ??

No (no access to CAD at the moment) - just following the logic of what (list 'quote (list (cons 'unprotect-assign funs))) should return :wink:

HasanCAD

  • Swamp Rat
  • Posts: 1421
Re: What's this message mean?
« Reply #12 on: August 02, 2015, 04:37:23 AM »
Code - Auto/Visual Lisp: [Select]
  1. Command: (pragma (list (cons 'unprotect-assign funs)))
  2. ; error: syntax error