Jump to content

Recommended Posts

Posted

maybe i am missing something simple. the below code works (to a point) i can insert the "grabm" block and then enter into the spline command. i can place as many points with the spline as i wish however i need to hit enter 3 times before i can place the text i want to. Below is the code and grabm block.

 


(defun c:gls ()
 (initerr)
 (setvar "cmdecho" 0)

(setvar "orthomode" 0) 
 (command "-style" "notes" "romans.shx" 
"4.5" ".85" "10" "n" "n" "n") 
 (setvar "osmode" 512)

(command "-insert" "grabm" pause "1" "1" pause)
(command 
"spline")
 (while (> (getvar "CMDACTIVE") 0) (command 
pause))
 (setvar "osmode" 0)
 (command "dtext" pause 
"0")
(reset)
(princ)
)


;;;*==========================================================
(defun 
initerr ()
 (setq oldortho (getvar "orthomode"))
 (setq 
oldlayer (getvar "clayer"))
 (setq oldsnap (getvar "osmode"))

(setq oldSTYLE (getvar "TEXTSTYLE"))
 (setq echo (getvar 
"cmdecho"))
 (setq temperr *error*)
 (setq *error* 
trap)

(princ)
)
;;;*===========================================================
(defun 
trap (errmsg)
 (command nil nil nil)
 (if 
(not
(member errmsg
 '("console break" "Function 
Cancelled"))
     )
   (princ 
(strcat "\nError: " errmsg))
 ) 
 (setvar "orthomode" 
oldortho)                

 (setvar "clayer" oldlayer)
 (setvar "osmode" 
oldsnap)
 (setvar "textstyle" oldstyle)
 (setvar "cmdecho" 
echo)
 (princ "\nError Resetting Enviroment ")

(terpri)
 (setq *error* temperr)

(princ)
) 
;;;*===========================================================
(defun 
reset ()
 (setvar "clayer" oldlayer)
 (setvar "osmode" 
oldsnap)
 (setvar "textstyle" oldstyle)
 (setvar "cmdecho" 
echo)
 (princ)
)


;;;*===========================================================



;;;*======================================================
(princ)

GRABM.dwg

Posted

Those 3 presses were required to end the points picking cycle, respectively to indicate that you want to fix the ends using default tangents. To get rid of those will need to resort to something that will analyze user's input (i.e. GRREAD) and act accordingly instead of passing control to the editor.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...