Jump to content

MVSETUP/Align/Rotate cause settings to be altered


"Mitch"

Recommended Posts

Reference: Using AutoCAD 2016; Microsoft Windows 10 Enterprise

 

My CAD folks,

I noticed that when I use MVSETUP through paper space viewport to align and rotate a view, many of the CAD settings are changed (object snap settings cleared, pickfirst settings changed, can no longer apply a command to a pre-selected object). And I no longer can grip select an item, as in a line - I’d have to apply stretch command to edit the line. Moreover, when I need to select an object, nothing happens when I apply the pickbox directly on the object; I’d have to ghostly pick an arbitrary distance away from the targeted object for it to even highlight and be selected.

God knows what other settings may have been inadvertently altered. So how can I get my settings restored?

Is this a known problem when using mvsetup/align/rotate? I often need to rotate viewport to fit a model space drawing favorably through paper space.

Is there another command I can use to affect the viewport rotation without affecting AutoCAD settings?

Or, how can I use the mvsetup/align/rotate without altering my settings?

Edited by "Mitch"
Link to comment
Share on other sites

From my research, I'd guess that part of the issue is the UCS. Once you change the viewport, start the UCS command and give the View option. Also look at your SNAPANG setting.

 

Another possibility (which may or may not work) is to create a view in model space, where you intend to create your viewport. Then, once you create the viewport, set it to the view.

  • Like 1
Link to comment
Share on other sites

  • 9 months later...

I've never used MVSETUP through paper space viewport to align and rotate a view for that reason. I used a DVIEW TWist macro for years, but BlackBox wrote a lisp that works really well:

https://forums.augi.com/showthread.php?174367-multiline-text-rotation&p=1344593#post1344593

My current macro:

^C^C_dview;all;;tw;\;^P(progn(setvar "snapang" (- (getvar "viewtwist")))(princ)) 

 

Had to update my macro a few versions back so this version should work for an older version: 

^C^C_.DVIEW;;_TW;\;^P(progn(setvar "snapang" (- (getvar "viewtwist")))(princ)) 

 

Edited by tombu
Trouble inserting code
  • Like 1
Link to comment
Share on other sites

Thanks for the suggestion above.

I tried to find DVIEW in the CUI but could not find it.

Using DVIEW as-is seems to work, I assume then the macro uses SNAPANG to catch onto a drawing element so that you don't have to enter the angle manually.

Link to comment
Share on other sites

4 minutes ago, sketch11 said:

I tried to find DVIEW in the CUI but could not find it.

Using DVIEW as-is seems to work, I assume then the macro uses SNAPANG to catch onto a drawing element so that you don't have to enter the angle manually.

You will have to pick a direction or enter a TWist value.

DVIEW is an AutoCAD command and TWist is the command option for what you want done.

The TWist value is stored in the viewtwist system variable. The portion below simply sets the snapang system variable to put the crosshairs horizontal.

^P(progn(setvar "snapang" (- (getvar "viewtwist")))(princ))

You don't need it in the macro unless you want the snapang to be horizontal. BlackBox's lisp version from the link allows you to snap to two points (osnap set to nearest) on a line to make that line horizontal in the viewport.

  • Like 1
Link to comment
Share on other sites

Thanks for assisting again.

Unfortunately I'm more confused now. If we can go back a step please.

 

- What does your macro, and BlackBox's macro do that DVIEW doesn't?

- I think I understand that DVIEW is an AutoCAD command so can' be edited. But TWist also seems to be in AutoCAD.

- With you macro, I assume I create a new command in the CUI and then write the one line of code in the "Macro" field?

Link to comment
Share on other sites

1 hour ago, sketch11 said:

- What does your macro, and BlackBox's macro do that DVIEW doesn't?

- I think I understand that DVIEW is an AutoCAD command so can' be edited. But TWist also seems to be in AutoCAD.

- With you macro, I assume I create a new command in the CUI and then write the one line of code in the "Macro" field?

Yes, you're right!

For my CUI View, Twist command:

Command Name    View, Twist

 Description             Set DVIEW TWist by picking or entering.

Macro                       ^C^C_dview;all;;tw;\;^P(progn(setvar "snapang" (- (getvar "viewtwist")))(princ)) 

Both Images            ViewTwist.png    Image attached below

 

BlackBox's View, TWist ↔ command with his code saved as "TWist.lsp" in a folder in both Support Path and Trusted Folders:

Command Name    View, TWist ↔

 Description             Pick two points.to Set DVIEW TWist.

Macro                       ^C^C^P(or C:TWist (load "TWist.lsp"));TWist

Both Images            ViewTwist.png

 

Both commands added in a drop-down in a custom View panel of our custom partial CUI.

ViewTwist.png

  • Like 1
Link to comment
Share on other sites

Thanks again.

I managed to get Blackbox's macro to work. For some reason I had issues with yours as "View, Twist" wasn't available.

It's all good now, something is working.

Cheers.

Link to comment
Share on other sites

8 hours ago, sketch11 said:

Thanks again.

I managed to get Blackbox's macro to work. For some reason I had issues with yours as "View, Twist" wasn't available.

It's all good now, something is working.

Cheers.

Glad BlackBox's lisp worked for you! The prompts for the DVIEW command changed slightly a few versions back, in my first post an additional macro I believe should work for older versions but I have no way to test it as all I use now is 2021 versions. While coding in lisp as BlackBox did requires a learning curve the code rarely needs updating .

 

Creating macro's is simple as noting how you achieve something using a command. Start with the command followed by a semicolon for enter. Each time user input is required add a \ each time you need to add a response like Yes or TWist add it and every time you need to hit enter while executing that command add another semicolon.

About Special Control Characters in Command Macros

Edited by tombu
  • Like 1
Link to comment
Share on other sites

UCS OB PLAN will twist to the orientation of an object.

 

Warning if object selected is say a 3d line the UCS will have a twist in the z plane as well so make sure say z is 0.

Link to comment
Share on other sites

A funny thing is happening, in that when I run the LISP, it clears the settings, as per the original query.

It happens when I run the macro and then click "Undo".

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...