| Author |
Message |
Daayo
Guest
|
Posted:
Mon Jan 10, 2005 8:35 pm Post subject:
Block Customization |
|
|
I have a block of a door & I would like to have 3 door tags inserted with
the door. The door tags are attributes with a block as well. The question I
have is the text changes size with the drawing scale. How can I have a lsp
or something that will only scale the door tags on insertion. Any help will
be appreciated. TIA,
Erik D.
|
|
| Back to top |
|
 |
Matt W
Guest
|
Posted:
Mon Jan 10, 2005 10:19 pm Post subject:
Re: Block Customization |
|
|
Try this...
| Code: |
; FROM ACADX.COM
;;;==================================================================
;;; (JustStem cFileName)
;;; Returns the stem name (the file name before the extension)
;;; from a complete path and file name.
;;;------------------------------------------------------------------
;;; Parameters:
;;; cFileName str to check
;;;------------------------------------------------------------------
;;; Returns:
;;; [STR]
;;; Example: (setq a "C:\\MyFolder\\MyFile.txt")
;;; (JustStem a) ; returns "MyFile"
;;;------------------------------------------------------------------
(defun JustStem (cFileName / fName DotLoc)
(setq fName (justFName cFileName))
(setq DotLoc (rat "." fName))
(if (> DotLoc 0)
(substr fName 1 (1- DotLoc))
fName
) ;_ end of if
) ;_ end of defun
; ALSO FROM ACADX.COM
;;;===========================================================================
;;; (Rat cSearchExpression cExpressionSearched)
;;; Returns the numeric position of the last (rightmost)
;;; occurrence of a character string within another character string.
;;;---------------------------------------------------------------------------
;;; Parameters:
;;; cSearchExpression [STR] - String to search for
;;; cExpressionSearched [STR] - String to search
;;;---------------------------------------------------------------------------
;;; Returns:
;;; [INT] - Posistion of the string
;;; Example: (setq a "A Lot of Text.")
;;; (Rat "Text" a) ; returns 10
;;;===========================================================================
(defun Rat (cSearch cSearchIn / return SearchFor cont n)
;; We need to escape for special characters
(cond
(
(= cSearch "\\")
(setq SearchFor "*`\\*")
)
(
(= cSearch ".")
(setq SearchFor "*`.*")
)
(
(= cSearch "#")
(setq SearchFor "*`#*")
)
(
(= cSearch "*")
(setq SearchFor "*`**")
)
(
(= cSearch "~")
(setq SearchFor "*`~*")
)
(
(= cSearch "-")
(setq SearchFor "*`-*")
)
(
(= cSearch ",")
(setq SearchFor "*`,*")
)
(
(= cSearch "`")
(setq SearchFor "*``*")
)
(
T
(setq SearchFor (strcat "*" cSearch "*"))
)
) ;_ end of cond
(cond
(
;; Make sure there is a match
(not (wcmatch cSearchIn SearchFor))
(setq return 0)
)
(
T
(setq n (strlen cSearchIn))
(setq TestStr (substr cSearchIn n))
(setq cont T)
(while Cont
(if (wcmatch TestStr SearchFor)
(progn
(setq Cont nil)
(setq return n)
) ;_ end of progn
(progn
(setq n (1- n))
(setq TestStr (substr cSearchIn n))
) ;_ end of progn
) ;_ end of if
) ;_ end of while
)
) ;_ end of cond
return
) ;_ end of defun
(DEFUN C:UCS-TEST ( / )
(COMMAND "UCS" "R" (STRCAT (JUSTSTEM (GETVAR "DWGNAME")) "-C"))
)
(PRINC)
|
--
I support two teams: The Red Sox and whoever beats the Yankees.
"Daayo" <erikdeyo at azz dot com> wrote in message
news:41e2a0ca$1_1@newsprd01...
| Quote: | I have a block of a door & I would like to have 3 door tags inserted with
the door. The door tags are attributes with a block as well. The question
I
have is the text changes size with the drawing scale. How can I have a lsp
or something that will only scale the door tags on insertion. Any help
will
be appreciated. TIA,
Erik D.
|
|
|
| Back to top |
|
 |
Matt W
Guest
|
Posted:
Mon Jan 10, 2005 10:19 pm Post subject:
Re: Block Customization |
|
|
Oops! Wrong post. Sorry.
--
I support two teams: The Red Sox and whoever beats the Yankees.
"Matt W" <nospam@address.withheld.com> wrote in message
news:41e2b907$1_2@newsprd01...
| Quote: | Try this...
| Code: |
; FROM ACADX.COM
;;;==================================================================
;;; (JustStem cFileName)
;;; Returns the stem name (the file name before the extension)
;;; from a complete path and file name.
;;;------------------------------------------------------------------
;;; Parameters:
;;; cFileName str to check
;;;------------------------------------------------------------------
;;; Returns:
;;; [STR]
;;; Example: (setq a "C:\\MyFolder\\MyFile.txt")
;;; (JustStem a) ; returns "MyFile"
;;;------------------------------------------------------------------
(defun JustStem (cFileName / fName DotLoc)
(setq fName (justFName cFileName))
(setq DotLoc (rat "." fName))
(if (> DotLoc 0)
(substr fName 1 (1- DotLoc))
fName
) ;_ end of if
) ;_ end of defun
; ALSO FROM ACADX.COM
;;;===========================================================================
;;; (Rat cSearchExpression cExpressionSearched)
;;; Returns the numeric position of the last (rightmost)
;;; occurrence of a character string within another character string.
;;;---------------------------------------------------------------------------
;;; Parameters:
;;; cSearchExpression [STR] - String to search for
;;; cExpressionSearched [STR] - String to search
;;;---------------------------------------------------------------------------
;;; Returns:
;;; [INT] - Posistion of the string
;;; Example: (setq a "A Lot of Text.")
;;; (Rat "Text" a) ; returns 10
;;;===========================================================================
(defun Rat (cSearch cSearchIn / return SearchFor cont n)
;; We need to escape for special characters
(cond
(
(= cSearch "\\")
(setq SearchFor "*`\\*")
)
(
(= cSearch ".")
(setq SearchFor "*`.*")
)
(
(= cSearch "#")
(setq SearchFor "*`#*")
)
(
(= cSearch "*")
(setq SearchFor "*`**")
)
(
(= cSearch "~")
(setq SearchFor "*`~*")
)
(
(= cSearch "-")
(setq SearchFor "*`-*")
)
(
(= cSearch ",")
(setq SearchFor "*`,*")
)
(
(= cSearch "`")
(setq SearchFor "*``*")
)
(
T
(setq SearchFor (strcat "*" cSearch "*"))
)
) ;_ end of cond
(cond
(
;; Make sure there is a match
(not (wcmatch cSearchIn SearchFor))
(setq return 0)
)
(
T
(setq n (strlen cSearchIn))
(setq TestStr (substr cSearchIn n))
(setq cont T)
(while Cont
(if (wcmatch TestStr SearchFor)
(progn
(setq Cont nil)
(setq return n)
) ;_ end of progn
(progn
(setq n (1- n))
(setq TestStr (substr cSearchIn n))
) ;_ end of progn
) ;_ end of if
) ;_ end of while
)
) ;_ end of cond
return
) ;_ end of defun
(DEFUN C:UCS-TEST ( / )
(COMMAND "UCS" "R" (STRCAT (JUSTSTEM (GETVAR "DWGNAME")) "-C"))
)
(PRINC)
|
--
I support two teams: The Red Sox and whoever beats the Yankees.
"Daayo" <erikdeyo at azz dot com> wrote in message
news:41e2a0ca$1_1@newsprd01...
I have a block of a door & I would like to have 3 door tags inserted with
the door. The door tags are attributes with a block as well. The question
I
have is the text changes size with the drawing scale. How can I have a
lsp
or something that will only scale the door tags on insertion. Any help
will
be appreciated. TIA,
Erik D.
|
|
|
| Back to top |
|
 |
|
|
|
|