Script file doesnt act the same through Autocad version

Script file doesnt act the same through Autocad version

nguyen.np
Participant Participant
472 Views
2 Replies
Message 1 of 3

Script file doesnt act the same through Autocad version

nguyen.np
Participant
Participant

Hi everyone.

I create script file via excel vba and then import to Autocad to do some tasks. But when I use that script file in other computer with different autoCad version, some case the result was not as I expected.

OSMODE 0
....
Color BYLAYER
PLINE 0,900 @0,122 @287,0 @0,-15 @Anonymous.61,10.61 @Anonymous.39,-54.39 @0,-4.4264 @-54.39,-54.39 @-10.61,10.61 @0,-15 0,900 
Color RED
TEXT S acisots 20,961 25 0 PART1 (287x122)x4
ZOOM W 387,1072 -20,880
GROUP C *  387,1072 -20,880
.....
OSMODE 167

 

result image.JPG

 I think there are something wrong with absolute/relative coordinates. I tried to change in Snap Setting -> dynamic input, but the result did not get better. Anyone with idea to fix this problem?

 

Thanks!

0 Likes
Accepted solutions (1)
473 Views
2 Replies
Replies (2)
Message 2 of 3

Ed__Jobe
Mentor
Mentor
Accepted solution

You can temporarily turn off running osnaps by setting OSMODE to 16384. You should use lisp to store the the current setting, then restore it after you're done.

 

(setq omode (getvar "OSMODE")

;;run your script

(setvar "OSMODE" omode)

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 3 of 3

nguyen.np
Participant
Participant

After change OSMODE 0 to OSMODE 16384, it worked perfectly!

Thank you very much!

 

0 Likes