Results 1 to 8 of 8

Thread: Reactor To Dimension Selection

  1. #1
    Member
    Join Date
    2006-02
    Posts
    17
    Login to Give a bone
    0

    Default Reactor To Dimension Selection

    I just need to know if this is possible. I'd like to get there on my own, but knowing if it can be done before I start is always nice =).

    All dimensions have ext #1 and ext #2. I'd like some type of reactor, once dimension is selected, to temporarily and graphically identify on screen which is which. Possible?

    Thanks for looking.

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Reactor To Dimension Selection

    Yes, it is possible.

    The reactor is going to be the simpler part to code, as compared to the transient graphics, IMO... But still entirely possible.

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    Member
    Join Date
    2006-02
    Posts
    17
    Login to Give a bone
    0

    Default Re: Reactor To Dimension Selection

    Perhaps, but I could do something simple like just change the color of each extension to something else right?

  4. #4
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Reactor To Dimension Selection

    Quote Originally Posted by chuh View Post
    Perhaps, but I could do something simple like just change the color of each extension to something else right?
    Perhaps I've misunderstood your original post....

    Are you asking for help setting up a reactor that identifies extension line #1 vs #2 on selection (both otherwise being the same color in dimension style), or are you asking if you can just change your dimension style so that each is a different color?
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  5. #5
    Member
    Join Date
    2006-02
    Posts
    17
    Login to Give a bone
    0

    Default Re: Reactor To Dimension Selection

    Quote Originally Posted by BlackBox View Post
    Perhaps I've misunderstood your original post....

    Are you asking for help setting up a reactor that identifies extension line #1 vs #2 on selection (both otherwise being the same color in dimension style), or are you asking if you can just change your dimension style so that each is a different color?
    lol...both.

    I suppose explaining the end goal always helps right? What I'd like to be able to do is setup a reactor that only responds when a single dimension is selected. Once selected it would somehow (graphically) identify on screen which extension was #1 and #2. This would allow the drafter to easily change the linetype of the extension leg without having to guess which one is which.

    So I figured that it would be easier to simply have the color of the extension lines change upon temporary selection in order to identify the #1 and #2 as an easy identification method.

    Could I use the :vlr-openedForModify under the vlr-object-reactor? And then could I use :vlr-objectClosed to restore the proper color once the object is deselected?

    Thoughts?

  6. #6
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Reactor To Dimension Selection

    Quote Originally Posted by chuh View Post
    lol...both.

    I suppose explaining the end goal always helps right? What I'd like to be able to do is setup a reactor that only responds when a single dimension is selected. Once selected it would somehow (graphically) identify on screen which extension was #1 and #2. This would allow the drafter to easily change the linetype of the extension leg without having to guess which one is which.

    So I figured that it would be easier to simply have the color of the extension lines change upon temporary selection in order to identify the #1 and #2 as an easy identification method.

    Could I use the :vlr-openedForModify under the vlr-object-reactor? And then could I use :vlr-objectClosed to restore the proper color once the object is deselected?

    Thoughts?
    That always helps. Haha

    I know of no way to change the color of only a single Extension Line, which is where I though to suggest transient graphics.

    Visual LISP Reactor Rule #13486: You cannot modify an Object being modified (that's only possible in higher level languages, such as .NET API). Most use ObjectModified Event to 'track' which Objects are being modified following a CommandWillStart Event (aka storing ObjectId[s]), so that at those ObjectIds can be 'processed' at CommandCancelled, CommandEnded, or CommandFailed Event (when said Object's are closed in the Database). Not really helpful here, but wanted to clarify.

    .NET API can get around this in a few different ways... Simplest for this situation to my mind, is to simply react to either *SelectionChanged Event, which is not exposed to LISP if memory serves, but would allow you to draw transient graphics when selected)... Or employ PointMonitor Event to only display transient graphics when hovering the applicable Object (like a Tool Tip, etc. that draws a red circle over Ext Line 1 coordinate, and yellow circle over Ext Line 2 coordinate as example).

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  7. #7
    Member
    Join Date
    2006-02
    Posts
    17
    Login to Give a bone
    0

    Default Re: Reactor To Dimension Selection

    Quote Originally Posted by BlackBox View Post
    That always helps. Haha

    I know of no way to change the color of only a single Extension Line, which is where I though to suggest transient graphics.

    Visual LISP Reactor Rule #13486: You cannot modify an Object being modified (that's only possible in higher level languages, such as .NET API). Most use ObjectModified Event to 'track' which Objects are being modified following a CommandWillStart Event (aka storing ObjectId[s]), so that at those ObjectIds can be 'processed' at CommandCancelled, CommandEnded, or CommandFailed Event (when said Object's are closed in the Database). Not really helpful here, but wanted to clarify.

    .NET API can get around this in a few different ways... Simplest for this situation to my mind, is to simply react to either *SelectionChanged Event, which is not exposed to LISP if memory serves, but would allow you to draw transient graphics when selected)... Or employ PointMonitor Event to only display transient graphics when hovering the applicable Object (like a Tool Tip, etc. that draws a red circle over Ext Line 1 coordinate, and yellow circle over Ext Line 2 coordinate as example).

    Cheers
    Thanks for the info BlackBox. I'll munch on this for a bit and see how I want to approach it.

  8. #8
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Re: Reactor To Dimension Selection

    Here is a way to directly change the linetype of extension lines.

    P=


    Code:
    ;___________________________________________________________________________________________________________
    ;
    ; Written By: Peter Jamtgaard Copyright 2015
    ; Extension Line Linetype Function (Change linetype of extension lines by selecting the extension line)
    ;___________________________________________________________________________________________________________;
    
    
    (defun C:ExtLt (/ entSelection 
                      lstEntity 
                      lstPoint0 
                      lstPoint1 
                      lstPoint2 
                      lstSelection 
                      objSelection
                      strExtensionLine 
                      strLineType)
     (if (and
          (setq lstSelection (entsel "\nSelect Extension Line in Dimension: "))
          (setq strLinetype  "Center")
          (tblObjName "Ltype" strLineType)
          (setq lstPoint0    (cadr lstSelection))
          (setq entSelection (car lstSelection))
          (setq lstEntity    (entget entSelection))
          (setq objSelection (vlax-ename->vla-object entSelection))
          (setq lstPoint1    (cdr (assoc 10 lstEntity)))
          (setq lstPoint2    (cdr (assoc 11 lstEntity)))
          (if (< (distance lstPoint0 lstPoint2)
                 (distance lstpoint0 lstPoint1))
           (setq strExtensionLine "ExtLine1Linetype")
           (setq strExtensionLine "ExtLine2Linetype") 
          )
         )
      (DimensionExtensionLineToggle objSelection strExtensionLine strLineType)
     )
    )
    
    ;___________________________________________________________________________________________________________
    ;
    ; Toggle to toggle the extension line linetype
    ;___________________________________________________________________________________________________________;
    
    (defun DimensionExtensionLineToggle (objSelection strExtensionLine strLineType)
     (if (= (vlax-get objSelection strExtensionLine) "ByBlock")
      (errortrap '(vlax-put objSelection strExtensionLine strLineType))
      (errortrap '(vlax-put objSelection strExtensionLine "ByBlock"))
     )
    )
    
    ;___________________________________________________________________________________________________________
    ;
    ; Errortrap Function
    ;___________________________________________________________________________________________________________;
    
    (defun ErrorTrap (symFunction / objError result)
     (if (vl-catch-all-error-p
          (setq objError (vl-catch-all-apply
                         '(lambda (X)(set X (eval symFunction)))
                          (list 'result))))
      nil
      (if result result 'T)
     )
    )
    
    (vl-load-com)
    Attached Files Attached Files
    Last edited by peter; 2015-05-04 at 05:58 PM.
    AutomateCAD

Similar Threads

  1. Replies: 0
    Last Post: 2014-05-09, 11:25 AM
  2. vlr-dwg-reactor issue MY FIRST REACTOR
    By treaves04413213 in forum AutoLISP
    Replies: 21
    Last Post: 2013-10-18, 12:36 PM
  3. Replies: 4
    Last Post: 2010-03-24, 09:19 AM
  4. Replies: 1
    Last Post: 2009-08-14, 01:05 PM
  5. Replies: 2
    Last Post: 2007-04-17, 03:08 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
  •