Jump to content
Developer Wiki and Function Reference Links ×

Viewports and Planes Views


Recommended Posts

@josue Corona ,

   I assume you mean to do this with VectorScript, considering where you posted your question?

 

   Here's a short script showing how to copy a view. The attached file shows the same thing, using the 1st design layer to set the view and a selected viewport to receive the view setting.  You can use a similar approach to get the view rotations of a working plane by using the GetWorkingPlane() command.

PROCEDURE xxx;
{ Example script to copy a Design Layer view and apply it to a Viewport. }
{ Select a Viewport. Run script. }
{ The script copies the view from the First Design Layer to the selected VP. }
{ 19 Jul 2019 - Raymond J Mullin }
VAR
	Hdl, Hvp :Handle;

	procedure ApplyViewFromDLtoVP(Hdl, Hvp :Handle);
	{ Copy the view from design layer (Hdl) to viewport (Hvp). }
	Var
		B :Boolean;
		Vr, Vc :Vector;
	Begin
		if (GetTypeN(Hvp) = 122) & (GetTypeN(Hdl) = 31) then
			if GetViewMatrix(Hdl, Vc.x, Vc.y, Vc.z,   Vr.x, Vr.y, Vr.z) then
				B := SetViewMatrix(Hvp, Vc.x, Vc.y, Vc.z,   Vr.x, Vr.y, Vr.z);
	End;	{ ApplyViewFromDLtoVP}


BEGIN
	Hvp := FSActLayer;		{ handle to selected VP }
	Hdl := FLayer;			{ handle to an arbitrary design layer }
	
	ApplyViewFromDLtoVP(Hdl, Hvp);		
	
	UpdateVP(Hvp);
	RedrawAll;
END;
Run(xxx);

 

   Not knowing what version of VW you are running I exported the file as v2016, (and for others using older versions.) Please add a signature to your profile. It really will help people answer your questions more accurately.

 

Raymond

 

Copy View from DL to VP v2016.vwx

 

Edited by MullinRJ
Link to comment

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
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...