See the top rated post in this thread. Click here

Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: DIM modifier

  1. #1
    Member fishervb's Avatar
    Join Date
    2000-12
    Location
    Hershey, PA
    Posts
    32
    Login to Give a bone
    0

    Default DIM modifier

    Greetings all! I'm looking for a LISP that will:
    1 - find/select all dims that have been changed from the true dimension
    2 - change the color of these dims to my choice
    3 - Show both the correct AND the incorrect dim

    My students don't seems to understand the importance of correct information in a drawing and I'm looking for a way to pinpoint these things quickly.....

    I've been able to get the first part to work, but no luck with the rest.
    Help?

  2. #2
    I could stop if I wanted to scwegner's Avatar
    Join Date
    2004-12
    Location
    Minneapolis, MN
    Posts
    449
    Login to Give a bone
    0

    Default Re: DIM modifier

    Quote Originally Posted by fishervb
    .

    I've been able to get the first part to work, but no luck with the rest.
    Help?
    Why don't you post what you have and we can help you out from there?

  3. #3
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: DIM modifier

    Hi fish ; ) punish the studets !
    Code:
    (defun c:DimFake (/ SelSet Index Correct Faked Ent Obj Fake Mea Hgt Col )
      (if (setq SelSet (ssget "_X" '((0 . "DIMENSION" ))) )
    	(progn
    	  (vl-load-com)
    	  (setq Index 0 Correct 0 Faked 0 )
    	  (while (setq Ent (ssname SelSet Index ) )
    		(setq Obj (vlax-ename->vla-Object Ent ) )
    		(if (not (= (setq Fake (vlax-get Obj "TextOverride" ) ) "" ) )
    		  (progn
    			(setq Mea (vlax-get  Obj "Measurement" ) )
    			(setq Hgt (vlax-get  Obj "TextHeight"  ) )
    			(setq Col (vlax-get  Obj "TextColor"   ) )
    			(vlax-put-property   Obj "TextOverride" (strcat (rtos Mea ) " <--[ " Fake  " ]" ) )
    			(vlax-put-property   Obj "TextHeight" (* Hgt 1.5 ) ) ;; Change textsize * 1.5
    			(vlax-put-property   Obj "TextColor"  (+ Col 1 ) ) ;; Change colornumber + 1
    			(vlax-release-Object Obj )
    			(setq Faked (1+ Faked ) )
    		  )
    		  (setq Correct (1+ Correct ) )
    		)
    		(setq Index (1+ Index ) )
    	  )
    	)
    	(princ "\No dimension found !")
      )
      (princ (strcat "\nCommand: " (itoa Faked ) " Faked dimensions found, and " (itoa Correct ) " correct." ) )
      (princ " Type Command: U to reset" )
      (princ)
    )
    : ) Happy Computing !

    kennet

  4. #4
    Member fishervb's Avatar
    Join Date
    2000-12
    Location
    Hershey, PA
    Posts
    32
    Login to Give a bone
    0

    Default Re: DIM modifier

    Kennett,
    Thanks! That works pretty well!
    (Maybe an option to pick the color I want and make the whole dim that color?)
    Fish

  5. #5
    Member fishervb's Avatar
    Join Date
    2000-12
    Location
    Hershey, PA
    Posts
    32
    Login to Give a bone
    0

    Default Re: DIM modifier

    I'd like to get the dim to have the wrong dim then in brackets the right dim.
    For Ex. 41.65 [41.82] where 41.82 is correct.
    Kennett's is very close (THANK YOU!!!) , I'd just like to pick my own color and make the whole dim that color. I show something like this on an overhead projector and need to be able to make the dim easy to spot for the whole room.
    This is what I started with.....(Kennett's is much more elegant....)

    (defun C:FDIM()
    ;;;--- Turn the command echo off
    (setvar "cmdecho" 0)
    ;;;--- Get a global selection set...
    (if
    ;;;--- Name the selection set [ eset ]
    (setq eset
    ;;;--- Get dimension objects that do not have a text value of ""
    (ssget "X"
    '((-4 . "<AND")(0 . "DIMENSION")(-4 . "<NOT")(1 . "")(-4 . "NOT>")(-4 . "AND>"))
    )
    )
    ;;;--- If a set was found...
    (progn
    ;;;--- Let the user select a color
    (setq clr(acad_colordlg 256))
    ;;;--- Change the dimesions to this color
    (command "change" eset "" "P" "C" clr "")
    )
    )
    ;;;--- Turn the command echo back on
    (setvar "cmdecho" 1)
    ;;;--- Suppress the last echo for a clean exit
    (princ)
    )

  6. #6
    I could stop if I wanted to msretenovic's Avatar
    Join Date
    2002-02
    Location
    Galloway, Oh
    Posts
    305
    Login to Give a bone
    0

    Lightbulb Re: DIM modifier

    Quote Originally Posted by fishervb
    I'd like to get the dim to have the wrong dim then in brackets the right dim.
    For Ex. 41.65 [41.82] where 41.82 is correct.
    Kennett's is very close (THANK YOU!!!) , I'd just like to pick my own color and make the whole dim that color. I show something like this on an overhead projector and need to be able to make the dim easy to spot for the whole room.
    Fish,
    Here is a modification of Kennet's code. Let me know if this is what you are wanting to do.
    (I just commented out the portion of code that I was changing so you can compare what was changed. I thought it might be a good learning tool. )

    Code:
     
    (defun c:DimFake (/ SelSet Index Correct Faked Ent Obj Fake Mea Hgt Col color text)
      (setq color (getint "Enter color number to change fake dimensions to: "))
      (if (setq SelSet (ssget "_X" '((0 . "DIMENSION" ))) )
     (progn
       (vl-load-com)
       (setq Index 0 Correct 0 Faked 0 )
       (while (setq Ent (ssname SelSet Index ) )
      (setq Obj (vlax-ename->vla-Object Ent ) )
      (if (not (= (setq Fake (vlax-get Obj "TextOverride" ) ) "" ) )
    	(progn
       ;;(setq Mea (vlax-get  Obj "Measurement" ) )
    	   (setq text (vla-get-textOverride Obj))  ;;get text override
       (setq Hgt (vlax-get  Obj "TextHeight"  ) )
       ;;(setq Col (vlax-get  Obj "TextColor"   ) )
       ;;(vlax-put-property   Obj "TextOverride" (strcat (rtos Mea ) " <--[ " Fake  " ]" ) )
    	   (vla-put-textOverride   Obj (strcat text " <--[ <> ]" ) ) ;;change text override to include real dim
       (vlax-put-property   Obj "TextHeight" (* Hgt 1.5 ) ) ;; Change textsize * 1.5
    	   (vla-put-color Obj color) ;;change color of dim
       ;;(vlax-put-property   Obj "TextColor"  (+ Col 1 ) ) ;; Change colornumber + 1
       (vlax-release-Object Obj )
       (setq Faked (1+ Faked ) )
    	)
    	(setq Correct (1+ Correct ) )
      )
      (setq Index (1+ Index ) )
       )
     )
     (princ "\No dimension found !")
      )
      (princ (strcat "\nCommand: " (itoa Faked ) " Faked dimensions found, and " (itoa Correct ) " correct." ) )
      (princ " Type Command: U to reset" )
      (princ)
    )

  7. #7
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: DIM modifier

    Ok fish, hope this is what You want
    Code:
    (defun c:DimFake (/ UserCol SelSet Index Correct Faked Ent Obj Fake Mea Hgt Col )
      (prompt "Command: Choose a bright color" ) ;; Let the user select a color
      (while (not (setq UserCol (acad_colordlg 256 ))) )
      (if (setq SelSet (ssget "_X" '((0 . "DIMENSION" ))) )
        (progn
          (vl-load-com)
          (setq Index 0 Correct 0 Faked 0 )
          (while (setq Ent (ssname SelSet Index ) )
            (setq Obj (vlax-ename->vla-Object Ent ) )
            (if (not (= (setq Fake (vlax-get Obj "TextOverride" ) ) "" ) )
              (progn
                (setq Mea (vlax-get  Obj "Measurement" ) )
                (setq Hgt (vlax-get  Obj "TextHeight"  ) )
                (setq Col (vlax-get  Obj "TextColor"   ) )
    ;;; I'd like to get the dim to have the wrong dim then in brackets the right dim. 
    ;;; For Ex. 41.65 [41.82] where 41.82 is correct.
                (vlax-put-property   Obj "TextOverride" (strcat Fake " [ <> ]" ) )
                (vlax-put-property   Obj "TextHeight" (* Hgt 1.5 ) ) ;; Change textsize * 1.5
                (vlax-put-property   Obj "TextColor"  UserCol ) ;; Change dimtext color
                (vla-put-color Obj UserCol ) ;; Change dim color
                (vlax-release-Object Obj )
                (setq Faked (1+ Faked ) )
              )
              (setq Correct (1+ Correct ) )
            )
            (setq Index (1+ Index ) )
          )
        )
        (princ "\No dimension found !")
      )
      (princ (strcat "\nCommand: " (itoa Faked ) " Faked dimensions found, and " (itoa Correct ) " correct." ) )
      (if (not (= Faked 0 )) (princ " Type Command: U to reset." ) ( ) )
      (princ)
    )
    : ) Happy Computing !
    . . . . and take care of the students

    kennet
    Last edited by kennet.sjoberg; 2005-02-25 at 07:59 AM.

  8. #8
    Member fishervb's Avatar
    Join Date
    2000-12
    Location
    Hershey, PA
    Posts
    32
    Login to Give a bone
    0

    Default Re: DIM modifier

    Kennett,
    That is awesome!!!
    using this little tool made a 2 hour job into about a 20 minute job.
    Thanks very much!!!!
    Fish

  9. #9
    Member
    Join Date
    2003-08
    Posts
    5
    Login to Give a bone
    0

    Default Re: DIM modifier

    Kennet,
    I tried using your dimension modifier and it certainly works using the standard dim style, but the routine bombs after changing the first dimension set to our company's dimstyle. I think the problem may be that our dimension text color is set to bylayer. Any suggestions?
    Win

  10. #10
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: DIM modifier

    Quote Originally Posted by whagen
    Kennet,
    I tried using your dimension modifier and it certainly works using the standard dim style, but the routine bombs after changing the first dimension set to our company's dimstyle. I think the problem may be that our dimension text color is set to bylayer. Any suggestions?
    Win
    This code find faked dimensions with "TextOverride" and mark them.
    What are you trying to do ?

    : ) Happy Computing !

    kennet

Page 1 of 3 123 LastLast

Similar Threads

  1. 2013: Modifier les niveaux
    By gio59_1185 in forum Revit Architecture - General
    Replies: 5
    Last Post: 2012-10-03, 02:12 PM
  2. Modifier un gabarit de famille
    By yusukens82 in forum Revit Architecture - General
    Replies: 2
    Last Post: 2010-01-05, 12:01 PM
  3. publish modifier.
    By sturner in forum AutoLISP
    Replies: 2
    Last Post: 2009-12-30, 04:08 PM
  4. Modifier famille par mur
    By yusukens82 in forum Revit Architecture - Families
    Replies: 2
    Last Post: 2008-11-23, 02:40 PM
  5. Wall Modifier
    By jhudtwalcker in forum Revit Architecture - General
    Replies: 6
    Last Post: 2006-07-02, 03:40 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
  •