Results 1 to 9 of 9

Thread: Dim Text Offset Problem ?

  1. #1
    Member
    Join Date
    2011-12
    Posts
    2

    Default Dim Text Offset Problem ?

    Hi
    I want to change dim text offset of the drawing zone with lisp. how can I do it?

  2. #2
    Active Member nod684's Avatar
    Join Date
    2008-09
    Location
    Singapore
    Posts
    63

    Default Re: Dim Text Offset Problem ?

    Quote Originally Posted by eren_esm731604 View Post
    Hi
    I want to change dim text offset of the drawing zone with lisp. how can I do it?
    try this :

    Code:
    (defun c:test (/ )
    (setq cmd1 (getvar "cmdecho")) 
    (setvar "cmdecho" 0) 
    (setq DIMNEW (entsel "\n Select Dimension to Adjust Dimension Text Offset:"))
    (command "dimoverride" "dimgap" "3" "" DIMNEW) <<<<----- change the "3" to your desired text offset
    (setvar "cmdecho" cmd1) 
    (princ)
    )
    "Memories fade but the scars still linger..."

  3. #3
    Member
    Join Date
    2011-12
    Posts
    2

    Default Re: Dim Text Offset Problem ?

    that is what I am looking for. thanks a lot.

  4. #4
    Active Member nod684's Avatar
    Join Date
    2008-09
    Location
    Singapore
    Posts
    63

    Default Re: Dim Text Offset Problem ?

    Quote Originally Posted by eren_esm731604 View Post
    that is what I am looking for. thanks a lot.
    No problem!
    "Memories fade but the scars still linger..."

  5. #5
    Member
    Join Date
    2012-06
    Posts
    9

    Default Re: Dim Text Offset Problem ?

    I've modified nod684's code a bit : credit goes to nod still for the help...

    This will enable you to input your desired Txt Offset and will also enable you to select multiple dimensions that you want to change :

    Code:
    (defun c:test (/ )
    (setq cmd1 (getvar "cmdecho")) 
    (setvar "cmdecho" 0)
    (setq TOffset (getreal "\nEnter Desired Text Offset :  "))
    (prompt "\nSelect Dimension to Adjust Dimension Text Offset:")
    	(while
    		(if (setq en (ssget '((0 . "DIMENSION"))))
    			(command "dimoverride" "dimgap" TOffset "" en "")
    		(Princ "\nNo Dimensions selected! Try again!")
    		)
    	)
    (setvar "cmdecho" cmd1) 
    (princ "\nDone!")
    (princ))
    Last edited by meandyoulagi367990; 2012-09-22 at 06:09 AM.

  6. #6
    Active Member nod684's Avatar
    Join Date
    2008-09
    Location
    Singapore
    Posts
    63

    Default Re: Dim Text Offset Problem ?

    Quote Originally Posted by meandyoulagi367990 View Post
    I've modified nod684's code a bit : credit goes to nod still for the help...

    This will enable you to input your desired Txt Offset and will also enable you to select multiple dimensions that you want to change :

    Code:
    (defun c:test (/ )
    (setq cmd1 (getvar "cmdecho")) 
    (setvar "cmdecho" 0)
    (setq TOffset (getreal "\nEnter Desired Text Offset :  "))
    (prompt "\nSelect Dimension to Adjust Dimension Text Offset:")
    	(while
    		(if (setq en (ssget '((0 . "DIMENSION"))))
    			(command "dimoverride" "dimgap" TOffset "" en "")
    		(Princ "\nNo Dimensions selected! Try again!")
    		)
    	)
    (setvar "cmdecho" cmd1) 
    (princ "\nDone!")
    (princ))
    thanks meandyou...i was thinking bout this
    but my one was done in a jiffy

    in fact haven't had time to check if working or not lolz!

    try this one; with Dimension Height as default Dimgap :

    Code:
     
    (defun c:test (/ )
    (setq cmd1 (getvar "cmdecho")) 
    (setvar "cmdecho" 0)
    (setq dimtxt (getvar "Dimtxt"))
    (setq TOffset (getreal "\nEnter Desired Text Offset :  <" (rtos Dimtxt) "> "))
    (if (= TOffset  nil) (setq TOffset  dimtxt))
    (prompt "\nSelect Dimension to Adjust Dimension Text Offset:")
    	(while
    		(if (setq en (ssget '((0 . "DIMENSION"))))
    			(command "dimoverride" "dimgap" TOffset "" en "")
    		(Princ "\nNo Dimensions selected! Try again!")
    		)
    	)
    (setvar "cmdecho" cmd1) 
    (princ "\nDone!")
    (princ))
    Last edited by nod684; 2012-09-24 at 05:35 AM.
    "Memories fade but the scars still linger..."

  7. #7
    Member
    Join Date
    2012-06
    Posts
    9

    Default Re: Dim Text Offset Problem ?

    Quote Originally Posted by nod684 View Post
    thanks meandyou...i was thinking bout this
    but my one was done in a jiffy

    in fact haven't had time to check if working or not lolz!

    try this one; with Dimension Height as default Dimgap :

    Code:
     
    (defun c:test (/ )
    (setq cmd1 (getvar "cmdecho")) 
    (setvar "cmdecho" 0)
    (setq dimtxt (getvar "Dimtxt"))
    (setq TOffset (getreal "\nEnter Desired Text Offset :  <" (rtos Dimtxt) "> "))
    (if (= TOffset  nil) (setq TOffset  dimtxt))
    (prompt "\nSelect Dimension to Adjust Dimension Text Offset:")
    	(while
    		(if (setq en (ssget '((0 . "DIMENSION"))))
    			(command "dimoverride" "dimgap" TOffset "" en "")
    		(Princ "\nNo Dimensions selected! Try again!")
    		)
    	)
    (setvar "cmdecho" cmd1) 
    (princ "\nDone!")
    (princ))
    now that's better! thanks for the addition

  8. #8
    I could stop if I wanted to Tharwat's Avatar
    Join Date
    2010-06
    Posts
    478

    Default Re: Dim Text Offset Problem ?

    @nod684

    Localizing variables is very important in all routines , except when it is needed globally for any specific case.

  9. #9
    Active Member nod684's Avatar
    Join Date
    2008-09
    Location
    Singapore
    Posts
    63

    Default Re: Dim Text Offset Problem ?

    Quote Originally Posted by Tharwat View Post
    @nod684

    Localizing variables is very important in all routines , except when it is needed globally for any specific case.
    Noted Tharwat thanks for the reminder...
    "Memories fade but the scars still linger..."

Similar Threads

  1. Family Offset from Wall Problem...
    By USMCBody in forum Revit MEP - Families
    Replies: 1
    Last Post: 2012-07-23, 08:10 PM
  2. Dimension Text Offset
    By brent.130528 in forum Revit Architecture - General
    Replies: 4
    Last Post: 2009-08-17, 05:37 PM
  3. Base offset problem with roofs
    By joe.138576 in forum Revit Architecture - General
    Replies: 3
    Last Post: 2007-07-18, 09:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •