UCS with a view and clipping planes

Discussion in 'AutoCAD' started by Jason Piercey, Apr 1, 2004.

  1. I have to adjust some existing saved views and can't
    seem to get the ucs to work with respect to clipping
    planes.

    (command ".ucs" "3" "0,0" "1,0,0" "0,0,1") gets me close
    to where I want to be but when I try and draw a line it
    appears to be "behind" the clipping plane.

    I can pick 3 points manually (using some existing line work
    to establish the points) but I have about 50 views to "fix"
    and would like to do this in one shot.

    What is it that I am overlooking? Hope I explained this
    well enough.
     
    Jason Piercey, Apr 1, 2004
    #1
  2. PS: (command "ucs" "v")

    gives the same results.
     
    Jason Piercey, Apr 1, 2004
    #2
  3. Perhaps I could explain this a bit better. As an example,
    I've got a 4 sided box (3d solids) that I need to view each
    'wall' in elevation from the inside looking out.

    I initially set up all these views manually and adjusted
    clipping planes to obscure objects in front of and behind
    the 'wall' I am viewing.

    Now one of these walls have moved, so I need to redefine
    the view and clipping planes.


    Some questions:

    Are clipping planes relative to the target point? If I adjust
    the target point, should the clipping planes follow?
    (I'm finding that not to be the case)

    What does using the view option within the ucs command base
    it's position on? (in and out of the paper).
     
    Jason Piercey, Apr 1, 2004
    #3
  4. Ok, try this:

    (command ".rectangle" "0,0" "@20',20'")
    (command ".extrude" (entlast) "" "6'-0" "")
    (setq outter (entlast))

    (command ".rectangle" "6,6" "@19',19'")
    (command ".extrude" (entlast) "" "6'-0" "")
    (setq inner (entlast))

    (setq target '(6.0 120.0 0.0))
    (setq camera '(6.25 120.0 0.0))

    (command ".subtract" outter "" inner "")

    (command ".dview" ""
    "points" target camera
    "clip" "f" "0.25"
    "clip" "b" "-6.25"
    ""
    )

    (command ".ucs" "view")

    (command ".zoom" "e")
    (command ".zoom" ".95x")

    (command ".view" "save" "test")

    Now, draw a vertical line crossing the 'wall' and issue
    the hide command. The line is placed behind.

    Now, with ortho on do a 3 point ucs, for the first point
    pick the bottom of the 'wall' using the near osnap then
    pick a point in the x direction and pick a point in the
    y direction.

    Draw another vertical line and issue the hide command.
    The line is now visible.

    Question, how can I establish that 3 point ucs by using
    the dxf codes defined in the saved view?
     
    Jason Piercey, Apr 2, 2004
    #4
  5. Jason Piercey

    OLD-CADaver Guest

    Let me understand this a little better.

    You have existing views that are already DVIEW clipped, and you're trying to set a ucs to match the view AND reside within the clipped boundaries. Is that an accurate partrayal of your problem?

    Build a macro to set the UCS ORIGIN to reside in the plane by selecting some point within the plane.

    (defun c:ucor ()
    (command "ucs" "v")
    (command "ucs" "o" "*0,0,0")
    (setq ptzo (GETPOINT "\nPick For UCS Z Elevation : "))
    (command "ucs" "o" (list 0.0 0.0 (caddr ptzo)))
    (princ)
    )
     
    OLD-CADaver, Apr 2, 2004
    #5
  6. Yes, that is accurate.
    Was what I was after, thanks OC.

    I will end up usnig this in the future just to avoid the
    user pick point. Looks like the "o" option changed
    to "m" at some point but both work.

    (setq data (tblsearch "view" "test"))
    (setq p (trans (cdr (assoc 12 data)) 0 1))
    (command "ucs" "m" p)

    --

    Autodesk Discussion Group Facilitator


    to match the view AND reside within the clipped boundaries. Is that an accurate partrayal
    of your problem?
     
    Jason Piercey, Apr 2, 2004
    #6
  7. Jason Piercey

    OLD-CADaver Guest

    Glad to help. Yeah the ORIGIN changed to MOVE somewhere between r14 and 2002. The little routine I posted has been around since R10 or R11.

    Ohhh... I like the little view read proggy. Never thought of that, thanks.
     
    OLD-CADaver, Apr 3, 2004
    #7
  8. Jason Piercey

    OLD-CADaver Guest

    Have you seen the attached?
     
    OLD-CADaver, Apr 3, 2004
    #8
  9. I've got something similar that I've used for a while
    but never could quite figure out the origin thing, so
    it was not complete but still helped in getting these
    views setup.
     
    Jason Piercey, Apr 5, 2004
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.