Gringo Posted September 8, 2008 Share Posted September 8, 2008 hey guys im trying to learn vba i already know a fair bit about lisp but want to move into vba would someone be able to show me how to do the following in vba?? ;1 (defun c:test () (princ) ) ;2 (setq dscl (getvar "dimscale")) ;3 (setvar "dimscale" 1) 4; (command "-linetype" "_s") ;5 (alert(strcat "\nthis is a test")) I just want to see how the simple things work in vba thanks Quote Link to comment Share on other sites More sharing options...
borgunit Posted September 8, 2008 Share Posted September 8, 2008 Sub Test() Dim vVar as variant 'Is a variant in case assigned to text or number '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' vVar = ThisDrawing.GetVariable ("DIMSCALE") ThisDrawing.SetVariable "DIMSCALE" , 1# 'lb sign included if no decimal ThisDrawing.SendCommand "-LINETYPE" & vbCr & "S" & vbCr & "ByLayer" & vbCr & vbCr ThisDrawing.Utility.Prompt "this is a test" End Sub oops.. If you want a pop up box it is... MsgBox "this is a test" Quote Link to comment Share on other sites More sharing options...
Gringo Posted September 10, 2008 Author Share Posted September 10, 2008 thanks. It healps heaps when transferring from lisp to VBA A couple more requests (setq ss1 (ssget "x")) (setq EntN (ssname ss1 1)) (setq EntL (entget EntN)) (setq EntT (cdr (assoc 0 EntL))) (setq EntC (assoc 62 EntL)) (setq ss2 (ssadd)) (if (not EntC) (ssadd EntN ss2) );if 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.