Hi all! First time poster here. Sorry if this has been answered before, I tried to search but didn't find anything.
I only recently started using Autocad this past January, but I have a programming background so I quickly discovered LISP and eventually OpenDCL. I'm trying to make a large program that automates part of my job and this is just one piece of the puzzle. What I want to do is have a form that gets user input about the project and fills in some MTexts with that info. That part works pretty well so far (tho once you guys get a look at my code, I bet there's a better way to do it
), but the next part is messing up the routine.
Once the user has filled in the form and hit submit, I populate some variables, close the form, then update the Mtext contents with the variables. Here's where it gets weird. Then I call the "insert" command and instead of inserting the block, it reopens the form and asks for the block name! If I remove this line and put it in it's own c:function and have the user call it separately, it works fine. So weird. Having a separate function works for now, but eventually I want this thing to run all on it's own without stopping. Anybody have a clue what's going on or a possible way around? TIA
(defun c:border_text
/Form1
/btn_submit#OnClicked
(/) (setq jobNum
(dcl
-Control
-GetText border_text
/Form1
/tb_jobNum
)) (setq projectName
(dcl
-Control
-GetText border_text
/Form1
/tb_projectName
)) (setq planType
(dcl
-Control
-GetText border_text
/Form1
/tb_planType
)) (setq address
(dcl
-Control
-GetText border_text
/Form1
/tb_address
)) (setq cityCountyState
(dcl
-Control
-GetText border_text
/Form1
/tb_cityCountyState
)) (setq mapNum
(dcl
-Control
-GetText border_text
/Form1
/tb_mapNum
)) (setq parcel
(dcl
-Control
-GetText border_text
/Form1
/tb_parcel
))
(dcl
-Form
-Close border_text
/Form1
)
(command "-insert" "P:/CSDG Standards/AutoCAD STD/CSDG Blocks/Stamps/Jim Stamp.dwg" '
(34.4163 17.5196) "" "" "") )