Block Customization

Discussion in 'AutoCAD' started by Daayo, Jan 10, 2005.

  1. Daayo

    Daayo Guest

    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.
     
    Daayo, Jan 10, 2005
    #1
  2. Daayo

    Matt W Guest

    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)
    
     
    Matt W, Jan 10, 2005
    #2
  3. Daayo

    Matt W Guest

    Oops! Wrong post. Sorry.

    --
    I support two teams: The Red Sox and whoever beats the Yankees.

     
    Matt W, Jan 10, 2005
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.