+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16
  1. #1
    Full Member
    Discipline
    Architectural
    Using
    AutoCAD 2016
    Join Date
    Jan 2018
    Posts
    32

    Default Geometric Center not working when objects are far away from 0,0,0

    Registered forum members do not see this ad.

    Hello guys
    I am typing this because i am out of ideas

    The problem we are having at the office is that when we try to use the geometric center with closed simple polygons, the geometric center is not quite in the center. Even with really simple polygons.

    I found online that the problem could be some imported elements from other programs (like archicad or arcgis or something like that) , and that if you move your elements near the 0,0,0 coordinate point, the problem is solved. BUT, as you guessed, we can not do that since we work with real coordinates and we need them exactly referenced (the coordinates).

    The weird thing is that, the "infected" files we have (the ones where the geometric center does not work) infect new files even if we copy a line or a polygon or anything at all.
    Another thing is that it only happens in autocad architecture (2017), we have autocad civil 2016 and the problem does not happen there

    I am attaching some files with the problem
    Attached Images
    Attached Files

  2. #2
    Super Moderator rkmcswain's Avatar
    Computer Details
    rkmcswain's Computer Details
    Operating System:
    Windows 10
    Computer:
    HP Z240
    CPU:
    i7-7700k @ 4.20GHz
    RAM:
    64GB
    Graphics:
    Nvidia Quadro P1000
    Primary Storage:
    0.5TB SSD
    Secondary Storage:
    1TB SATA
    Monitor:
    Vizio 40"
    Discipline
    Civil
    Using
    Civil 3D 2019
    Join Date
    Sep 2005
    Location
    Houston
    Posts
    4,572
    R.K. McSwain
    CAD Panacea | twitter

  3. #3
    Full Member
    Discipline
    Architectural
    Using
    AutoCAD 2016
    Join Date
    Jan 2018
    Posts
    32

    Default

    thanks rkmcswain but i already read all of that.
    In that link the problem is not even solved (even if it is marked as solved)
    They came up with a solution which i said in my post (moving objects nearer the 0,0,0 point). The OP of that link at the end says that "that solution" does not work for him, (the same as me)

  4. #4
    Super Member CyberAngel's Avatar
    Computer Details
    CyberAngel's Computer Details
    Operating System:
    Windows 10
    Discipline
    Architectural
    CyberAngel's Discipline Details
    Occupation
    Civil Drafter
    Discipline
    Architectural
    Details
    Roofing and Waterproofing
    Using
    AutoCAD 2014
    Join Date
    Jul 2006
    Location
    Anywhere Else
    Posts
    1,209

    Default

    Have you tried redefining your UCS so that the objects are close to the origin but have the proper coordinates? I've worked with state plane coordinates before, and that seems to help with this kind of issue.

    Of course, this doesn't explain the "infection" issue. That points to something else.

    Edit: I assume you tried AUDIT and RECOVER and antivirus scanning and all that. So it could be a bug.
    Last edited by CyberAngel; 7th Mar 2018 at 06:07 pm.
    breaking AutoCAD on a regular basis since 1991

  5. #5
    Full Member
    Discipline
    Architectural
    Using
    AutoCAD 2016
    Join Date
    Jan 2018
    Posts
    32

    Default

    yes CyberAngel. i already tried that.
    I am starting to think that there is a problem with the geometric center and polygons with arcs as segments in our version of autocad. I will try to use the same files with other versions of autocad as soon as i can.

    What really bothers me is that we did not have that problem before. There was a point in time where one by one my colleages starting having it in their files.
    Last edited by xxfaxx; 7th Mar 2018 at 04:15 pm. Reason: more informaton

  6. #6
    Super Moderator rkmcswain's Avatar
    Computer Details
    rkmcswain's Computer Details
    Operating System:
    Windows 10
    Computer:
    HP Z240
    CPU:
    i7-7700k @ 4.20GHz
    RAM:
    64GB
    Graphics:
    Nvidia Quadro P1000
    Primary Storage:
    0.5TB SSD
    Secondary Storage:
    1TB SATA
    Monitor:
    Vizio 40"
    Discipline
    Civil
    Using
    Civil 3D 2019
    Join Date
    Sep 2005
    Location
    Houston
    Posts
    4,572

    Default

    If you have not already, send that DWG file to Autodesk with your Support Case request. There is something wrong for sure. It's not just the large coordinates.
    I purposely created some polygons at locations where the X and Y were in the hundreds of millions and I cannot get it to give me an incorrect gcen osnap point.

    I found a couple of your closed polylines where the gcen osnap was incorrect, and noticed that if I moved them slightly, the incorrect osnap point moved also, to a new incorrect location.
    R.K. McSwain
    CAD Panacea | twitter

  7. #7
    Full Member
    Discipline
    Architectural
    Using
    AutoCAD 2016
    Join Date
    Jan 2018
    Posts
    32

    Default

    thanks guys
    If i ever come up with a solution (or find it somewhere else) i will post it here.

  8. #8
    Super Member
    Computer Details
    tombu's Computer Details
    Operating System:
    Windows 7 64-bit
    Computer:
    Dell
    Discipline
    Civil
    tombu's Discipline Details
    Occupation
    Design Analyst
    Discipline
    Civil
    Details
    Small Street & Stormwater projects. Traffic Calming and other issues.
    Using
    Civil 3D 2018
    Join Date
    Dec 2010
    Location
    Tallahassee, FL USA
    Posts
    814

    Default

    Slightly modified version of a Lee Mac routine:
    Code:
    ;Center of closed polygon
    ;^P(or C:pc1 (load "pc1.lsp"))(pc1)
    ; (load "pc1.lsp")(pc1)
    (defun pc1 ( / acdoc acspc acsel reg pt) (vl-load-com) ;; © Lee Mac 2011
    
      (setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object))
            acspc (vlax-get-property acdoc (if (= 1 (getvar 'CVPORT)) 'Paperspace 'Modelspace))
      )
    ;  (if (ssget "+.:E:S")
      (if (ssget "+.:E:S" '((0 . "LWPOLYLINE") (-4 . "&=") (70 . 1)))
        (progn
          (vlax-for obj (setq acsel (vla-get-ActiveSelectionSet acdoc))
            (setq pt(trans (vlax-get (setq reg (car (vlax-invoke acspc 'addregion (list obj)))) 'Centroid) 1 0))
            (vla-delete reg)
          )
          (vla-delete acsel)
        )
      )
      pt
    )
    Added macro to Object Snap Cursor Menu years before Geometric Center was added.
    Command Name: Snap, Centroid
    Description: Snap to Centroid of closed Polyline
    Macro: ^P(or C:pc1 (load "pc1.lsp"))(pc1)

    It might work for you as a workaround.
    Layer 0 for ByBlock Block entities, everything else ByLayer. So many issues can be solved with good templates.

  9. #9
    Full Member
    Discipline
    Architectural
    Using
    AutoCAD 2016
    Join Date
    Jan 2018
    Posts
    32

    Default

    Audit and recover did not work neither. It is definitely a bug
    Thanks for the lisp tombu, but we already use an add-in called "arkitool" that has been helping us for years. We used it before autocad 2016 when we had no geometric center osnap.
    Last edited by xxfaxx; 8th Mar 2018 at 10:03 pm.

  10. #10
    Senior Member dtkell's Avatar
    Computer Details
    dtkell's Computer Details
    Operating System:
    Win7
    CPU:
    Intel I5 4670
    RAM:
    16mb
    Discipline
    Civil
    dtkell's Discipline Details
    Occupation
    Drafter/Designer
    Discipline
    Civil
    Using
    AutoCAD 2014
    Join Date
    Dec 2006
    Location
    San Diego, CA, USA
    Posts
    153

    Default

    Registered forum members do not see this ad.

    Just a wild shot, but as with the hatching problem far away from the 0,0,0 origin, if you change the "SNAPBASE" to something near your desired entity do you get the desired results? Not having the referenced program release, cannot try it.

Similar Threads

  1. Using the Geometric Center object snap
    By AutoCAD Tips Blog in forum AutoCAD RSS Feeds
    Replies: 1
    Last Post: 4th May 2015, 01:00 am
  2. AutoCAD 2016: Geometric Center Osnap
    By AutoCAD Insider in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 10th Apr 2015, 01:30 pm
  3. Move objects radially from(to) center
    By p0peye in forum AutoLISP, Visual LISP & DCL
    Replies: 12
    Last Post: 16th Apr 2014, 07:33 am
  4. manipulating geometric objects
    By cotsy in forum AutoCAD Beginners' Area
    Replies: 7
    Last Post: 22nd Jan 2011, 06:22 pm
  5. Geometric Center Of A Figure?
    By dirtlegg in forum AutoCAD Drawing Management & Output
    Replies: 8
    Last Post: 29th Jan 2008, 05:06 pm

Tags for this Thread

Bookmarks

Posting Permissions

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