TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Prickle Farmer on March 03, 2015, 05:56:35 PM

Title: Snapmode coming on when not wanted
Post by: Prickle Farmer on March 03, 2015, 05:56:35 PM
I have inherited some lisp software and I'm trying to update it for users on Acad2015.  Somehow the software changes snapmode to on (1).  I am aware of SNAPMODE command, SETVAR SNAPMODE, F9 function key and the snapmode button at the bottom of the acad screen.  Does anyone know any other way to invoke snapmode that I can search for in the code?
Title: Re: Snapmode coming on when not wanted
Post by: Prickle Farmer on March 04, 2015, 12:58:49 AM
I found it!!!  Nothing extraordinary, just code that ran a legacy "SNAP" command buried in a function call.  It only took me 12 hours to find it.
Title: Re: Snapmode coming on when not wanted
Post by: ronjonp on March 04, 2015, 09:19:52 AM
12 hours! That must be a lot of code :). Anyhoo .. .welcome to TheSwamp.
Title: Re: Snapmode coming on when not wanted
Post by: Prickle Farmer on March 04, 2015, 06:14:39 PM
Thanks ronjonp.   65 .lsp files totaling 415 Kb so at about 30 lines of code per Kb that means about 12,500 lines of code.  A reasonable size haystack!!
Title: Re: Snapmode coming on when not wanted
Post by: Lee Mac on March 04, 2015, 07:02:46 PM
If you set the indexing options in Windows 7 to index the contents of .lsp files, you can use the standard Windows Explorer search bar to search all .lsp files for keywords such as 'snapmode' etc.

Alternatively, you could use a 'Find in Files' functionality offered by most code editors, such as Notepad++.
Title: Re: Snapmode coming on when not wanted
Post by: Prickle Farmer on March 04, 2015, 07:45:19 PM
Thanks Lee.  I must update my old ways.  I am 56 years old and still use command line stuff eg.  FIND "this text" *.lsp>results.txt  I use Notepad ++ so I will check out Find in Files.
BTW I admire your work. I have used you dynamic block visibility functions in some of my code.  I take data from another software package and change the visibility of dynamic blocks based on that data.
Title: Re: Snapmode coming on when not wanted
Post by: RAYAKMAL on March 04, 2015, 09:44:56 PM
I use free utility 'SearchmyFiles' from www.nirsoft.net.
No installation needed.
It really works for me.
Title: Re: Snapmode coming on when not wanted
Post by: Lee Mac on March 05, 2015, 12:27:07 PM
BTW I admire your work. I have used you dynamic block visibility functions in some of my code.  I take data from another software package and change the visibility of dynamic blocks based on that data.

Many thanks Prickle Farmer - I'm delighted to hear that you find my functions useful!  :-)