Jump to content

LISP works on mine but only partial on others


Recommended Posts

Posted

I have an issue that needs a seasoned AutoCAD user. I have a very complex set of LISP routines that are used for scaffold design. The user fills in parameters for the scaffold. The parameters are sent to the command line in a string of "(setq var blabla) statements.

I have been using the LISPs for quite some time and they work flawlessly on my computer using my 2016 version of AutoCAD. When others at my work place use the LISPs they glitch.

All users are using the same version "2016" (I had heard some LISP routines don't perform the same on other releases of AutoCAD so I made sure all users have the same version.)

From watching the actions unfold on the screen, I can tell that some of the 3 dimensional points (that are defined as lists), are not being set or not being used. The items are inserted in the drawing to a specific point, then a second point is used for rotation or orientation of the inserted item. Some times (on the other computers) the item is inserted to a point defined in the last session and sometimes the second point ,used for orientation is not in the right place. This only happens when many points need to be developed. a basic or small scaffold with few points to be defined doesn't have the issue so I was thinking it may have to do with segment size or number of segments but am unsure of how to manipulate this and wonder why My computer never has the glitch but almost every other computer does.

Can someone tell me how to verify that all computers have AutoCAD set up EXACTLY the same.?

Also open to suggestions on how to solve this issue. 

Posted

First thing you should check is the OSMODE setting.

Posted

Roy

 Thanks for reading , but OSMODE will not come into play as the issue occurs mid-LISP . Part way through the LISP (you can watch the scaffold being built on the screen) the items start being inserted in the wrong place (not inserted on an intersection or end point some where "wrong" but inserted at an old "defined point" wrong). When inserting or using a point for orientation the prompt is "specify a point" and CAD waits, if no point is specified by a variable (or if the variable specified has  a nil value) CAD hangs in wait for a point to be defined by keyboard entry or mouse click.

  This problem doesn't occur on my computer, because of that, I think it is a settings issue. (Although I was able to figure out how to write LISP coding in a way that helps my team design much more quickly and efficiently, and have been using Auto CAD for 20 years, I am not well versed at the set up end of things in Auto CAD)

  I checked the OSMODE setting, and just to verify I will have the team members experiencing issues "suppress all" (toggle OSNAP to off) and check for changes .

 

Thanks again Ron

Posted

Without seeing the lisp code it is very difficult to assess why it is working on one machine and not another. It could be system variables or non localised variables......etc.

Posted

I have made as many variables "local" as I can. Could there be differences in the systems allowing my computer to store the points (list variables) but not other users systems. How can we compare system set ups?

I will be unable to post the code.

Also, how I would like to approach this is, match up the other users systems settings etc. to mine. It all works without issues on my system. Could there be a memory setting( in AutoCAD or Windows) that allows my system to save the points/list variables. Is there a way to compare system settings?

Thanks for any help on this issue dlanorh

 

Posted

You can dump a list of all system variables using "Express Tools" -> "Tools" -> "System Variable Editor" -> saveall button. This will dump all the system variable names and current settings to a text file with the *.svf? extension. Your problem is then comparing other dumps with yours. If this is the problem it is likely a sysvar you haven't taken into account.

 

If you are using global variables to pass info then these need to be as unique as possible. You can include " * , % , $ , - , _ .." into variable names

Posted

Thank you, I am going to try that. I'll let you know.

Thanks again dlanorh

Posted

IMO you are placing the cart infront of the donkey -

You should try debugging your code, by breaking down its structure into code blocks, and check if the same arguments are passed,

One way to easily determine where exactly your program failed is by using the cond function.

 

(cond 
  ( (not (setq args (GetArgumentsFromUser)))
    (prompt "\nError #1")
  )  
  ( (not (setq rslt (ProcessArguments args)))
    (prompt "\nError #2") (prompt "\nMaybe invalid arguments were passed in 'ProcessArguments' function.")
  )
  ( (not (setq rslt2 (ProcessAgain rslt)))
    (prompt "\nError #3")
  )
  ( (not (setq tmp (DoingSomeOtherStuff)))
    (prompt "\nError #4")
  )
); cond 

 

And like  dlanorh said it may be from the lisp or system variables, that your code uses.

I've had issue with one of my programs where I used (getvar 'loginname) to construct my dictionary key, but it was dfferent on my other PC.
So I used a constant string instead.

 

Another thing could be if you use command calls, the required arguments may be different between the versions, so that requires manual tracing,

Posted

I am using command calls, but all users are using AutoCAD 2016.

I have asked the users for a " system variables " dump and am going to compare for differences.

 

Thanks Grrr

Posted (edited)

Why don't you set 'break on error' and troubleshoot this in the VLIDE ? You're not really giving us much to work with. IMO .. I'd try to remove as many command calls from your code as possible.

image.png.b39783be56ceea39c6a753f68855ab74.png

Edited by ronjonp
Posted

If that fails, and you have some idea where the code is failing, run it in "vlide" set a break toggle and variable watches and step though the code to see what is happening and why.

Posted

To be brutal put a (exit) in your code it will bomb it out and you can check what all the variables are, its hitting the code with a sledge hammer, if you have to do this. Put some (alert printvariables etc) in place this stops the code but lets you continue.

Using break on error in vlide is ok but you may already have gone past the problem point as you mention it does work up to a point.

3rd idea is like Grrr I paste chunks of code to the command line to test, the only thing is you must not have blank lines between the code lines and remove comment lines. Paste your defuns 1st.

Definately compare the variables open up two seperate notepad's and just scroll down.

 

 

 

Posted

Thank You all for the help. The issue was a combination of 2 things, A corrupt block and system variable settings. Problem Solved.

  • Like 1
Posted
On 11/22/2018 at 7:24 AM, Guy Borgford said:

Thank You all for the help. The issue was a combination of 2 things, A corrupt block and system variable settings. Problem Solved.

What system variable?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...