Jump to content

Re-Associate WCS/Orthographic Views


Recommended Posts








This situation is becoming more prevalent so I'm posting a fix here. Even though the problem is cropping up more often, I don't see this routine needing to be run more than once or twice in any CAD users career.

In light of that, I'm not wasting time with bundling this as an addin - it shall remain simply as a NETLOAD to run DLL. For those nervous about pre-compiled code, see the source below.

And, as you can see from the source, the simplicity of the code does not deserve the special treatment of Autodesk's Bundle system.


The compiled code is compatible with AutoCAD 2016 - 2018, though it may run on versions prior. More than likely, the unzipped file will need to be UnBlocked before it will run:



More than likely, the DLL will need to be on the users system, preferably in the Support File Search Path.


// (C) Copyright 2017 by Sean Tessier
using System;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.EditorInput;

[assembly: CommandClass(typeof(STSC_ReAssociateViews.STSCCommands))]

namespace STSC_ReAssociateViews

   public class STSCCommands

       [CommandMethod("STSCGroup", "ReAssociateViews", "RAV", CommandFlags.Modal)]
       public void OpInit()
           Document doc = Application.DocumentManager.MdiActiveDocument;
           Database Db = doc.Database;

           using (Transaction acTrans = Db.TransactionManager.StartTransaction())
               Db.SetWorldUcsBaseOrigin(new Point3d(), OrthographicView.TopView);
               Db.SetWorldUcsBaseOrigin(new Point3d(), OrthographicView.BottomView);
               Db.SetWorldUcsBaseOrigin(new Point3d(), OrthographicView.FrontView);
               Db.SetWorldUcsBaseOrigin(new Point3d(), OrthographicView.BackView);
               Db.SetWorldUcsBaseOrigin(new Point3d(), OrthographicView.RightView);
               Db.SetWorldUcsBaseOrigin(new Point3d(), OrthographicView.LeftView);





Edited by SEANT
Added Commit
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...