Author Topic: Turn off clipping planes in current view  (Read 11564 times)

0 Members and 1 Guest are viewing this topic.

MickD

  • Gator
  • Posts: 3314
  • (x-in)->[process]->(y-out)
Re: Turn off clipping planes in current view
« Reply #15 on: February 22, 2006, 08:19:52 PM »
Here's macro from the toolbutton that toggles the front clip plane, can someone make sense of it??

Code: [Select]

^C^C_dview$M=$(if,$(or,$(eq,$(getvar,tilemode),1),$(!=,$(getvar,cvport),1)),$(if,$(and,$(getvar,viewmode),2),$(if,$(and,$(getvar,viewmode),4), _all  _cl _off _cl _b _on^M, _all  _cl _off^M), _all  _cl _f $(getvar,frontz)^M)^Z)

« Last Edit: February 22, 2006, 08:30:49 PM by MickD »
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Turn off clipping planes in current view
« Reply #16 on: February 22, 2006, 08:30:15 PM »
Yes, but they are just parameters to the DVIEW command, dependant on MSpace/Pspace settings.

only usefull if you were to use SendCommand ...
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

MickD

  • Gator
  • Posts: 3314
  • (x-in)->[process]->(y-out)
Re: Turn off clipping planes in current view
« Reply #17 on: February 22, 2006, 08:35:41 PM »
Thanks Kerry.

I think the clue is in the code posted by Luis earlier in that the record is not added to the  view table and therefore not a 'saved' view, it's just used to set up params for a view to be passed to the global function to set the camera up.

It really looks as though I'll have to set up my own view tools but that's ok as I can create a .cfg file to let the user set them up a little different if required.

Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

Chuck Gabriel

  • Guest
Re: Turn off clipping planes in current view
« Reply #18 on: February 22, 2006, 08:43:25 PM »
This works for paperspace viewports.  Not exactly what you were looking for I know, but maybe somebody will find a use for it.

Code: [Select]
//
// ObjectARX defined commands

#include "StdAfx.h"
#include "StdArx.h"
#include "dbents.h"
#include "dbobjptr.h"

void cgabClipPlanesViewUnclipped() {
AcDbObjectId curVpId = acedGetCurViewportObjectId();
AcDbObjectPointer<AcDbViewport> pVport(curVpId, AcDb::kForWrite);
if(pVport.openStatus() != Acad::eOk) {
acutPrintf("\nUnable to retrieve current viewport");
return;
}
pVport->setBackClipOff();
pVport->setFrontClipOff();
pVport->updateDisplay();
}

void cgabClipPlanesViewClipped() {
AcDbObjectId curVpId = acedGetCurViewportObjectId();
AcDbObjectPointer<AcDbViewport> pVport(curVpId, AcDb::kForWrite);
if(pVport.openStatus() != Acad::eOk) {
acutPrintf("\nUnable to retrieve current viewport");
return;
}
pVport->setBackClipOn();
pVport->setFrontClipOn();
pVport->updateDisplay();
}

MickD

  • Gator
  • Posts: 3314
  • (x-in)->[process]->(y-out)
Re: Turn off clipping planes in current view
« Reply #19 on: February 22, 2006, 08:47:11 PM »
Thanks Chuck, that will come in handy real soon :)
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

MickD

  • Gator
  • Posts: 3314
  • (x-in)->[process]->(y-out)
Re: Turn off clipping planes in current view
« Reply #20 on: February 22, 2006, 09:26:19 PM »
Here's what I'll be using as a base for my own iso views etc. Just change the vector values to change the viewing direction.
Code: [Select]
static void View_swiso(void)
{
// function to set an sw-iso view with clip planes turned off
// you would normally use this or similar functions when coming
// out of a named view that could possibly have the clipping planes
// turned on. Example only...use at your own risk! MickD Feb 2006

AcDbViewTableRecord view; //temp view object
AcGeVector3d* viewDirVec = new AcGeVector3d(-1.0,-1.0,1.0);
struct resbuf rb;
acedGetVar("TILEMODE", &rb);
int tilemode = rb.resval.rint;
acedGetVar("CVPORT", &rb);
int cvport = rb.resval.rint;

// set Paperspace flag
bool paperspace = ((tilemode == 0) && (cvport == 1)) ? Adesk::kTrue : Adesk::kFalse;
view.setIsPaperspaceView(paperspace);
if (Adesk::kFalse == paperspace)
{
view.setFrontClipEnabled(false);
view.setBackClipEnabled(false);
view.setViewDirection(*viewDirVec);
acedSetCurrentView(&view,NULL); //set it!
// a work around for a lot of code for now ;)
acedCommand(RTSTR, "_zoom", RTSTR, "_extents", RTNONE);
}
else
{
acutPrintf("\nCan't turn off clipping planes in paperspace!");
}

}
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Turn off clipping planes in current view
« Reply #21 on: February 22, 2006, 09:45:11 PM »
Quote
         // a work around for a lot of code for now ;)
         acedCommand(RTSTR, "_zoom", RTSTR, "_extents", RTNONE);

hehehehehe ....
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

MickD

  • Gator
  • Posts: 3314
  • (x-in)->[process]->(y-out)
Re: Turn off clipping planes in current view
« Reply #22 on: February 22, 2006, 10:08:23 PM »
heh, You like that Kerry :)

Truth be known, that is probably safer than anything I could write to do the same thing but I will do the exercise when time permits ;)
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

MickD

  • Gator
  • Posts: 3314
  • (x-in)->[process]->(y-out)
Re: Turn off clipping planes in current view
« Reply #23 on: February 22, 2006, 10:15:39 PM »
Seek and you shall recieve!
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

Bryco

  • Water Moccasin
  • Posts: 1849
Re: Turn off clipping planes in current view
« Reply #24 on: February 23, 2006, 12:46:57 AM »
Mick is the name Active or *Active. The express database viewer calls it the latter. If so does arx accept "*Active" or is it "`*Active"

MickD

  • Gator
  • Posts: 3314
  • (x-in)->[process]->(y-out)
Re: Turn off clipping planes in current view
« Reply #25 on: February 23, 2006, 01:00:40 AM »
Thanks Bryco, I'll just having a look now, I'll probably have to try both the view and viewport objects to see what happens but I'm guessing it will be a viewport object in mspace.
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

MickD

  • Gator
  • Posts: 3314
  • (x-in)->[process]->(y-out)
Re: Turn off clipping planes in current view
« Reply #26 on: February 23, 2006, 01:38:20 AM »
Nope, no good.
I'm actually resigned to creating my own view tools anyway so that it eliminates the extra command to unclip once you've changed views and it allows views to be slightly off perfect iso so that you can see all the lines without them being hidden behind others as is the case with the std view settings.
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

Bill::Meat4Brains

  • Guest
Re: Turn off clipping planes in current view
« Reply #27 on: February 23, 2006, 02:28:07 PM »
Rather than turn it off...  What about just moving the clipping plane?  Have you tried that?

MickD

  • Gator
  • Posts: 3314
  • (x-in)->[process]->(y-out)
Re: Turn off clipping planes in current view
« Reply #28 on: February 23, 2006, 03:50:06 PM »
Rather than turn it off... What about just moving the clipping plane? Have you tried that?

Hi Bill::
The problem is that they are still on in an isometric view after being in a ortho type view that had them on. Moving them would work but would involve a few extra commands. I could just use the 3dorbit toolbar and turn them off (my work around at the moment) but I want it to seem more natural to the user that when they switch to a std view it will be as expected.
What I'm trying to do is create saved views that can be used when needed in a 3d model to eliminate the 'noise' of other objects at that particular place in the model (say a section), this makes it easier to see what you are working on. These views will also be available when creating viewports in paper space for documentation so you can have clipped sections and plans in your drgs without having to set them up, just use the saved view for the viewport.
If you download the drg I attached in a previous post and set the saved view and you would see what I mean, try different iso views and it can get pretty bad.
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: “To attain knowledge, add things
every day; to obtain wisdom, remove things every day.”

Bryco

  • Water Moccasin
  • Posts: 1849
Re: Turn off clipping planes in current view
« Reply #29 on: February 23, 2006, 10:34:02 PM »
acedVports2VportTableRecords() was mentioned here  http://discussion.autodesk.com/thread.jspa?forumID=33&threadID=455267 just to muddy it up further.