Results 1 to 3 of 3

Thread: Reactor that will change the text of a dimension every tim a new Dimension is created

  1. #1
    100 Club
    Join Date
    2006-11
    Location
    UTAH
    Posts
    135
    Login to Give a bone
    0

    Question Reactor that will change the text of a dimension every tim a new Dimension is created

    I'm trying to make a reactor that will change the text of a dimension everytime a new Dimension is created, unless custom text is entered... Anyway, for some reason that I can't figure out, the Reactor will not fire, at least as far as I can tell. That may have something to do with the fact that I know NOTHING about reactors right now, and so have no idea how to make them work... I've checked a couple routines posted here and it seems to me that I'm doing everything fine, and yet it still will not work... Here's the code...

    Code:
    (vl-load-com)
    (setq NewDimReactor (vlr-acdb-reactor '((:vlr-objectAppended . My_Dim_Reactor))))
    (defun My_Dim_Reactor (Reactor_Name New_Object / Item End e1 dis)
      (alert New_Object)
      (if (or (= (cdr New_Object) "ARC_DIMENSION")
               (= (cdr New_Object) "DIMENSION")
          )
        (progn
          (foreach Item (entget (entlast))
    	(if (= (cdr Item) "AcDb3PointAngularDimension")
    	  (setq End 1)
    	)
          )
          (if (not end)
    	(setq e1  (entget (entlast))
    	      dis (cdr (assoc 42 e1))
    	)
    	(if (= (cdr (assoc 1 e1)) "")
    	  (progn
    	    (ad:tran)
    	    (setq e1 (subst (cons 1 tx) (assoc 1 e1) e1))
    	    (entmod e1)
    	  )
    	)
          )
        )
      )
    )

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

    Default Re: Reactor that will change the text of a dimension every tim a new Dimension is created

    You are missing the data to be associated with a reactor object; otherwise nil, if no data
    Code:
    (vl-load-com)
    (setq NewDimReactor (vlr-acdb-reactor nil   '((:vlr-objectAppended . My_Dim_Reactor))))
    Then you have to figure out some kind of filter in the function . . .
    run my code when creating different objects . . .and be surprised when dimensions.
    Code:
     
    (defun My_Dim_Reactor (Reactor_Name New_Object / Item End e1 dis)
      (alert (cdr (assoc 0 (entget (cadr New_Object )))))
     ;(alert (cdr (assoc 0 (entget (entlast)))))
    )

    : ) Happy Computing !

    kennet

  3. #3
    100 Club
    Join Date
    2006-11
    Location
    UTAH
    Posts
    135
    Login to Give a bone
    0

    Default Re: Reactor that will change the text of a dimension every tim a new Dimension is created

    Quote Originally Posted by kennet.sjoberg
    You are missing the data to be associated with a reactor object; otherwise nil, if no data
    That did it! Didn't understand that line in the helpfile... Once I put anything in there, it finally started firing and (obviously) throwing all types of error messages... :S
    Quote Originally Posted by kennet.sjobert
    Then you have to figure out some kind of filter in the function . . .
    run my code when creating different objects . . .and be surprised when dimensions.
    You're right. Using the "New_Object" that the reactor gives off wouldn't be necessary for what I need it for... Way too much computation done for that, even with a fairly simple routine such as mine.

    Thanks a lot.

Similar Threads

  1. Dimension text height won't change
    By bart.lydon in forum AutoCAD General
    Replies: 17
    Last Post: 2020-05-07, 05:48 PM
  2. Change Dimension Text Orientation
    By GreyHippo in forum AutoCAD General
    Replies: 4
    Last Post: 2016-06-20, 01:11 PM
  3. 2012: How to change dimension text size when sent to paperspace
    By lorne.bourdo.152516 in forum ACA General
    Replies: 2
    Last Post: 2013-04-11, 03:11 PM
  4. Dimension global text style change
    By Don Sutherland in forum Revit Architecture - General
    Replies: 1
    Last Post: 2006-02-24, 06:41 PM
  5. Dimension text size change
    By markm.66285 in forum AutoCAD General
    Replies: 3
    Last Post: 2004-07-26, 01:36 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
  •