mojo8997 Posted May 5, 2010 Share Posted May 5, 2010 Hey guys, im getting better at lisp but now i also want to dig into a little vba also, i hear its helpful to learn both if possible, i have a lsp that sets a var and i want it to show up in a vba text box i tried this but its not working, thanks for any advice in advance! (testing does a (setq testing 12345) Private Sub UserForm_Initialize() ThisDrawing.SendCommand "testing" & vbCr TextBox1.Text = ThisDrawing.GetVariable("test") End Sub Quote Link to comment Share on other sites More sharing options...
MSasu Posted May 5, 2010 Share Posted May 5, 2010 First, GetVariable statement is used to list the value of system variable, that it built-in variables that control drawing environment. So, cannot be used to list a user defined AutoLISP variable. Second, since just getting started, maybe is better to consider the .Net customization approach; this is due to the fact that the VBA technology is dropped by both Microsoft and Autodesk. See: http://www.cadtutor.net/forum/showthread.php?t=33211 http://www.cadtutor.net/forum/showthread.php?t=34389 http://www.cadtutor.net/forum/showthread.php?t=40154 http://www.cadtutor.net/forum/showthread.php?t=41247 http://www.cadtutor.net/forum/showthread.php?t=42385 Regards, Quote Link to comment Share on other sites More sharing options...
MSasu Posted May 5, 2010 Share Posted May 5, 2010 To get that AutoLISP – VBA communication done may try to use the user system variables USERI1-5, USERR1-5 and USERS1-5; but the quantity of data that can be transferred this way is limited. AutoLISP: (setq USERS1 “TransferedString”) VBA: ThisDrawing.GetVariable "USERS1" Regards, Quote Link to comment Share on other sites More sharing options...
MSasu Posted May 5, 2010 Share Posted May 5, 2010 You may also take a look on that: http://autolisp-exchange.com/Forums/Forum6/F6T7P1.htm. Regards, Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 5, 2010 Share Posted May 5, 2010 You can save variables in the user?? these are basicly 15 variables 5 as Integer 5 as string 5 as a real its a good simple way if you only work in house it can have a problem if external software "ADD ONS" also change these values I was involved in some software and we took advantage of this and save various variables in these such as scale, thickness of walls etc You can also write to the register and save a variable value but its only local on your pc, otherwise look into extended entities which get saved into the drawing. Quote Link to comment Share on other sites More sharing options...
mojo8997 Posted May 5, 2010 Author Share Posted May 5, 2010 very cool, thanks for the info! let me see what i can come up with. I would like to learn .net because vba is being dropped, i guess i should start looking into it, thanks again! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 6, 2010 Share Posted May 6, 2010 have a look at this http://www.cadtutor.net/forum/showthread.php?t=47652 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.