flowerrobot Posted December 3, 2008 Share Posted December 3, 2008 I have searched and could only find vba code for this, and i kno nothing of the stupied simple code, but any way I am trying to insert a dynamic block with the a paramaters included (defun c:ip() (setq oldlayer (getvar "-.layer")) (setvar "cmdecho" 0) (setq sc (getvar "dimscale")) (SETQ LA (GETVAR "OSMODE")) (COMMAND "LAYER" "S" "DIM" "") (command "osmode" 5) (setq pt1(getpoint "\nSELECT FIRST POINT : ")) (setq pt2(getpoint "\nSELECT SECOND POINT : ")) (SETQ XA ((CAR PT1)-(CAR PT2))) ; not sure if these are correct (SETQ YA (CAR PT1)-(CAR PT2)) (SETQ LG (SQROOT(XA)^2+(YA)^2)) (SETQ AG (SIN^-1 (XA/YA))) (COMMAND "INSERT" "ITA" PT1 SC SC 0) I WANT TO PLACE IMPUT IN THIS BIT HERE LENGTH = LG ANGLE = AG (COMMAND "LAYER" "S" OLDLAYER "") (command "osmode" la) (Setvar cmdecho 1) (princ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 3, 2008 Share Posted December 3, 2008 This'll get you started - I haven't got the time to be thinking too much (defun c:ip (/ oldlayer oldcmd sc oldsnap pt1 pt2 lg ag) (setq oldlayer (getvar "clayer")) (setq oldcmd (getvar "cmdecho")) (if (/= (setq sc1 (getvar "dimscale")) 0.0) (setq sc sc1) (setq sc 1.0)) ; end if (setq oldosnap (getvar "osmode")) (if (not (tblsearch "layer" "DIM")) (command "-layer" "m" "DIM" "") (setvar "clayer" "DIM") ) ; end if (command "osmode" 5) (if (and (setq pt1 (getpoint "\nSELECT FIRST POINT : ")) (setq pt2 (getpoint "\nSELECT SECOND POINT : ")) ) ; end and (progn (setq lg (distance pt1 pt2)) (setq ag (angle pt1 pt2)) (command "insert" "ITA" pt1 sc sc 0) ; I WANT TO PLACE IMPUT IN THIS BIT HERE ; LENGTH = LG ; ANGLE = AG ) ; end progn ) ; end if (setvar "clayer" oldlayer) (setvar "osmode" oldsnap) (setvar "cmdecho" oldcmd) (princ) ) Quote Link to comment Share on other sites More sharing options...
flowerrobot Posted December 3, 2008 Author Share Posted December 3, 2008 Cheers, must say you are very conisise with you layouts arnt you, some thing im quite lacking in. good to kno distance and angle is that easy to create, just need to be able to place that info into the dynamic blocks properites Quote Link to comment Share on other sites More sharing options...
ASMI Posted December 3, 2008 Share Posted December 3, 2008 > flowerrobot It seems you ask a question about dynamic block parameters http://www.cadtutor.net/forum/showthread.php?t=29624 Quote Link to comment Share on other sites More sharing options...
flowerrobot Posted December 11, 2008 Author Share Posted December 11, 2008 Sorry i dnt relise you had replied to me their, and i dnt want to high jack his thread, and it also gives an easyer search from some one eles cheers 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.