Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: AutoLISP to Highlight Non-Associative Trans-spatial Dimensions

  1. #1
    Member
    Join Date
    2007-01
    Posts
    5

    Default AutoLISP to Highlight Non-Associative Trans-spatial Dimensions

    Greetings AUGI Users,

    Does anyone have a AutoLISP program that will highlight non-associative trans-spatial dimensions? I got one from a user named "Constantin" on the AutoDesk forum (see code on next thread), but it does not cover all the possible cases.

    Step 1. create two circles in model space
    Step 2. switch to paper space and make a viewport (any scale)
    Step 3. make a horizontal trans-spatial associative dimension from the center of each circle

    Case 1.
    If you list the dimension it shows the associative state = "yes" and if you cycle thru the dimension using dimreassociate you see that both endpoints are connected
    Program worked correctly and did not highlight the dimension...

    Case 2.
    Now go to the model space and delete one circle.
    If you list the dimension it shows the associative state = "yes" BUT if you cycle thru the dimension using dimreassociate you see that one endpoint was orphaned by the deleted circle. It seems to me that the associate state = "almost".
    I need the program to highlight this dimension because of the orphaned endpoint...

    Case 3.
    Now go to the model space and delete the other circle.
    If you list the dimension it shows the associative state = "no" and if you cycle thru the dimension using dimreassociate you see that both endpoints were orphaned.
    The program worked correctly and highlight this dimension...

    The program works great for Case 1 and 3, however, it is Case 2 that I need the most.

    For our company Case 2 is very important because instead of a simple circle that gets deleted...it is a block. Whats happens is...a block (say a pump in plan view) gets deleted and a large one is put back into the same position. The dimension(s) that located the smaller pump look like they are connected to the new larger pump when in fact the one point was orphaned. Later, another design moves the new large pump and now the dimesnion was not updated....On a large complex drawing this dimension can get mised.

    Is there a way to test the endpoints instead of
    '(102 . "{ACAD_REACTORS")

    Thanks In Advance...

  2. #2
    Member
    Join Date
    2007-01
    Posts
    5

    Default Re: AutoLISP to Highlight Non-Associative Trans-spatial Dimensions

    Here is the code that was provided by "Constantin"...dont forget to load (vl-load-com) before using it....

    http://discussion.autodesk.com/threa...hreadID=532584
    Last edited by RichardNoggin; 2007-01-15 at 08:22 PM. Reason: Removed actual code and added link

  3. #3
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,706

    Default Re: AutoLISP to Highlight Non-Associative Trans-spatial Dimensions

    You can also try this, but all dimensiontypes is not included radial diam. . .
    Code:
    CODE REMOVED
    : ) Happy Computing !

    kennet
    Last edited by kennet.sjoberg; 2007-01-14 at 02:25 PM. Reason: CODE REMOVED

  4. #4
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,706

    Default Re: AutoLISP to Highlight Non-Associative Trans-spatial Dimensions

    New code works in ModelSpace, PaperSpace, Viewport, All dimensiontypes, Reverse mark. . .
    Code:
    (defun c:NoAsso (/ Space SelSet DimNr AssoNr NoAssoNr Ent EntDxf Index Item Legs ) ; *Redraw*
      (if (not *Redraw* ) (setq *Redraw* 3 ) (if (= *Redraw* 3 ) (setq *Redraw* 4 ) (setq *Redraw* 3 )) )
      (if (>= (getvar "CVPORT" ) 2 ) (setq Space "Model" ) (setq Space (getvar "CTAB" )) )
      (if (setq SelSet (ssget "X" (list  (cons -4 "<AND") (cons 0 "DIMENSION") (cons 410 Space ) (cons -4 "AND>"))) ) ;; Select all dimensions i CS
        (progn
          (setq DimNr 0 AssoNr 0 NoAssoNr 0 )
          (while (setq Ent (ssname SelSet DimNr )) ;; Investigate all dimensions in the selectionset
            (setq EntDxf (entget Ent ) )
            (if (member '(102 . "{ACAD_REACTORS") EntDxf ) ;; Check for a reactor in present dimension
              (progn
                (setq Index 0 Item nil Legs nil )
                (repeat (length EntDxf ) ;; Find the reactor in the dxfcode of present dimension
                  (if (equal (nth Index EntDxf ) '(102 . "{ACAD_REACTORS"))
                    (progn
                      (setq Item (cdr (nth (1+ Index ) EntDxf ))) ; When found, take next item
                      (setq Legs 0 )
                      (foreach Item_in (entget Item ) ;; Count asso points in present dimension
                        (if (equal Item_in '(1 . "AcDbOsnapPointRef")) (setq Legs (1+ Legs )) ( ) )
                      )
                      (cond
                        ((and (< Legs 3 ) (member '(100 . "AcDb2LineAngularDimension") EntDxf )) (redraw Ent *Redraw* ) (setq NoAssoNr (1+ NoAssoNr )) )
                        ((and (= Legs 1 ) (member '(100 . "AcDbRadialDimension"      ) EntDxf )) (princ (strcat "\rASSO = " (itoa (setq AssoNr (1+ AssoNr ))))) )
                        ((and (= Legs 1 ) (member '(100 . "AcDbDiametricDimension"   ) EntDxf )) (princ (strcat "\rASSO = " (itoa (setq AssoNr (1+ AssoNr ))))) )
                        ((and (= Legs 1 ) (member '(100 . "AcDbOrdinateDimension"    ) EntDxf )) (princ (strcat "\rASSO = " (itoa (setq AssoNr (1+ AssoNr ))))) )
                        ((and (= Legs 1 ) (member '(100 . "AcDbRadialDimensionLarge" ) EntDxf )) (princ (strcat "\rASSO = " (itoa (setq AssoNr (1+ AssoNr ))))) )
                        ((= Legs 1 ) (redraw Ent *Redraw* ) (setq NoAssoNr (1+ NoAssoNr )) )
                        (t (princ (strcat "\rASSO = " (itoa (setq AssoNr (1+ AssoNr ))))) )
                      )
                    )
                    ( )
                  )
                  (setq Index (1+ Index ) )
                )
              )
              (progn
                (redraw Ent *Redraw* ) ;; Reactor is missing, mark present dimension
                (setq NoAssoNr (1+ NoAssoNr ))
              )
            )
            (setq DimNr (1+ DimNr ) ) ;; Prepare for next dimension
          )
          (princ (strcat ", NoAsso = " (itoa NoAssoNr )) )
        )
        (princ ". . no dimension found in current space" )
      )
      (princ " . . run again [Enter] to reverse mark." )
      (princ)
    )
    : ) Happy Computing !

    kennet
    Last edited by kennet.sjoberg; 2007-01-14 at 05:30 PM. Reason: Changed ">" to ">=" for CVPORT

  5. #5
    Member
    Join Date
    2007-01
    Posts
    5

    Default Re: AutoLISP to Highlight Non-Associative Trans-spatial Dimensions

    GREAT STUFF!!!

    It works perfectly...

    If you don't mind I am going to post your program on the AutoDESK forum to help other users...

    Thanks Again...
    Last edited by RichardNoggin; 2007-01-15 at 08:03 PM. Reason: The above code was modified to work for all types...

  6. #6
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,706

    Default Re: AutoLISP to Highlight Non-Associative Trans-spatial Dimensions

    Quote Originally Posted by r1100r98
    GREAT STUFF!!!

    It works perfectly...and for our company radial dimensions account for only about 1%...so your program is a great workaround.

    If you don't mind I am going to post your program on the AutoDESK forum to help other users...
    If I want to post my program to other forums . . . I can do it myself.

    : ) Happy Computing !

    kennet

  7. #7
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    6,836

    Default Re: AutoLISP to Highlight Non-Associative Trans-spatial Dimensions

    Quote Originally Posted by r1100r98
    GREAT STUFF!!!

    It works perfectly...and for our company radial dimensions account for only about 1%...so your program is a great workaround.

    If you don't mind I am going to post your program on the AutoDESK forum to help other users...

    Thanks Again...
    I would recommend you post a link to this thread or to kennet's post. That will allow others to see the context for the code.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  8. #8
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,706

    Default Re: AutoLISP to Highlight Non-Associative Trans-spatial Dimensions

    Quote Originally Posted by Opie
    I would recommend you post a link to. . .
    Yes, and that will maybe increase the number of users in this forum . . . and that will make me happy.

    : ) Happy Computing !

    kennet

  9. #9
    Member
    Join Date
    2007-01
    Posts
    5

    Default Re: AutoLISP to Highlight Non-Associative Trans-spatial Dimensions

    Greetings AUGI Forum Users,

    Sorry for any "bretch of etiquette"...I have added the link to this thread on the other forum...

    Regards...

  10. #10
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,706

    Default Re: AutoLISP to Highlight Non-Associative Trans-spatial Dimensions

    Quote Originally Posted by r1100r98
    Greetings AUGI Forum Users,

    Sorry for any "bretch of etiquette"...I have added the link to this thread on the other forum...

    Regards...
    < snip from the other forum >
    Sorry for the delay of this reply. After Constantin gave the "bad news" I signed up for a AUGI account and posted the same question over there. One of their users named kennet.sjoberg posted some code that works except for radial dimensions. Here is a link to his post...

    ? ? My code works for all dimensiontypes !

    : ) Happy Computing !

    kennet

Page 1 of 2 12 LastLast

Similar Threads

  1. Trans Spatial Dimensions giving me wacky value???
    By 3D_PB in forum AutoCAD General
    Replies: 4
    Last Post: 2008-04-28, 01:45 PM
  2. Find / Highlight non-associative dims
    By Kid-Zort in forum AutoCAD General
    Replies: 2
    Last Post: 2007-06-19, 03:18 PM
  3. Dim's Where? Your Input on Trans-spatial Use
    By chillme1 in forum CAD Standards
    Replies: 5
    Last Post: 2007-01-15, 06:56 PM
  4. Associative dimensions, how do they work
    By gfreddog in forum AutoCAD General
    Replies: 1
    Last Post: 2006-11-30, 08:40 PM
  5. Replies: 2
    Last Post: 2006-05-09, 07:43 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
  •