Author Topic: UCS Model Space Rotation  (Read 3048 times)

0 Members and 1 Guest are viewing this topic.

cadman6735

  • Guest
UCS Model Space Rotation
« on: November 28, 2012, 09:20:27 AM »
Need some help finding the right approach

I have a base file that the MS (Model Space) UCS "Z" is rotated, in this case 90deg.  When this base file is referanced into another file it comes in at the "Z" rotation of the current host file "World", so the UCS "z" needs to be rotated 90deg to mach the base file.  I created a small macro that will allow the users to rotate the UCS via one command vs. making sure the UCS follow is "1" and so on - Macro as below.

Code: [Select]
(defun c:msr ( / ucsf r)

  (setq ucsf (getvar "ucsfollow"))

  (command "ucsfollow" 1)
  (setq r (getstring "\nEnter Angle of View Rotation: "))
  (command "ucs" "z" r)

  (setvar "ucsfollow" ucsf)

(princ)
)

Thinking I was good to go but....   the only issue now is that if another referance is xrefed in it too comes in as the WSC of the base file (90deg out of wack) so to fix this the user has to make sure to UCS is set back to World then xref in the file then rotate the UCS "z" again back to 90.

I am trying to figure out a way to rotate my current (Sheet File) UCS by selecting the xref (base file) to match its current UCS rotation and bring in new xrefs at the correct UCS rotation of the Sheet file.

Something like:
First:
Select xref to match UCS rotation (now the current view rotates to match the selected xref UCS rotation)

Second:
Maybe a reactor to Xref command that will rotate UCS to World insert referance file then rotate UCS back to working UCS rotation.  (<- this one I think I can do myself but not sure how to go about the first one)

Thanks for any guidence.

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: UCS Model Space Rotation
« Reply #1 on: November 28, 2012, 10:18:54 AM »
Hi,

Did you try to rotate the view without changing the UCS ?

Code: [Select]
(defun c:msr (/ r)
  (if (setq r (getangle "\nEnter Angle of View Rotation: "))
    (command "_dview" "" "_twist" (angtos r (getvar 'aunits) 16) "")
  )
  (princ)
)
Speaking English as a French Frog

cadman6735

  • Guest
Re: UCS Model Space Rotation
« Reply #2 on: November 28, 2012, 10:43:49 AM »
Hi Gile,

This was my first idea was to use dview, but I need/want to match how the original Architect created his view so the Engineers and the Architects are working the exact same way.  Plus I need the UCS to be set to "view" so X,Y are correct, (X, Left, Right) (Y, Up, Down)

But...

Now I am thinking I am trying to creat magic where magic is not needed.  (over thinking it)...  I will just creat another macro that will turn the UCS back to "world" insert xref then run the C:MSR command again and rotate it back and the Engineers will just have to remember to do so.

I just thought it would be a cool to learn how to access the UCS coordinates from an xref and .......

I am going to bail on this idea and just create the second macro.

Thank you Gile 

Happy Holidays

I just realized what you gave me...  THANKSSSSSSSS
« Last Edit: November 28, 2012, 10:50:06 AM by cadman6735 »

cadman6735

  • Guest
Re: UCS Model Space Rotation
« Reply #3 on: November 28, 2012, 11:03:51 AM »
almost.

they come in correct but once I change the UCS to "view" the next xref comes in wayout in space.  I still have an extra step to modify the UCS back to "world" before inserting another xref...  Not a big deal


Thanks again

ronjonp

  • Needs a day job
  • Posts: 7526
Re: UCS Model Space Rotation
« Reply #4 on: November 28, 2012, 11:10:29 AM »
almost.

they come in correct but once I change the UCS to "view" the next xref comes in wayout in space.  I still have an extra step to modify the UCS back to "world" before inserting another xref...  Not a big deal


Thanks again

I think a command reactor would be the way to go.
XREF command called
UCS switches to world
XREF is inserted
UCS switches back to view

This what you're looking for? (didn't read the whole thread)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

cadman6735

  • Guest
Re: UCS Model Space Rotation
« Reply #5 on: November 28, 2012, 12:37:35 PM »
Ron, yes

thank you, that would work with my code and giles....

from my original post

Quote
Second:
Maybe a reactor to Xref command that will rotate UCS to World insert referance file then rotate UCS back to working UCS rotation.  (<- this one I think I can do myself but not sure how to go about the first one)

I didn't put it together and was making this harder than I think I should...

Thank you both, I can move on from here.....

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: UCS Model Space Rotation
« Reply #6 on: November 29, 2012, 12:01:28 AM »
I'm just asking a silly question: What industry are you in? In some of them it's not a good idea to have all your drawings drawn in a UCS then XRef direct into WCS - accuracy problems and extra work with xrefs.
 
In Arch I've learned the hard way NOT to do this. Instead each DWG is drawn in its OWN WCS - keeping as much of the lines perpendicular to X/Y as possible. Then when xreffing it is placed at some location and rotated. Makes for a lot less work in the long run, not to mention you tend to not find those nagging fractional dimension discrepancies as you do when your lines are at angles.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.