Block Customization
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Block Customization

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
Daayo
Guest





Posted: Mon Jan 10, 2005 8:35 pm    Post subject: Block Customization Reply with 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 Reply with 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...
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 Reply with quote

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
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB