Jump to content
Developer Wiki and Function Reference Links ×

Push & Pop Constrains


WhoCanDo

Recommended Posts

Hello @WhoCanDo ,

   The constraint settings can be accessed by preference numbers. Here's a routine I wrote a couple of years ago that will do what you're looking for.

	function GetSnaps :String;
	{ Return a string with the current SNAP settings. }
	Var
		S :String;
	Begin
		S := '';
		if GetPref(37) then S := 'A';			{ Snap to Grid }
		if GetPref(1312) then S := concat(S, 'S');	{ Snap to Angle }
		if GetPref(1314) then S := concat(S, 'D');	{ Smart Points }
		if GetPref(1316) then S := concat(S, 'F');	{ Smart Edge }
	
		if GetPref(38) then S := concat(S, 'Q');	{ Snap to Object }
		if GetPref(1313) then S := concat(S, 'W');	{ Snap to Intersection }
		if GetPref(1315) then S := concat(S, 'E');	{ Snap to Distance }
		if GetPref(1317) then S := concat(S, 'R');	{ Snap to Tangent }
		GetSnaps := S;
	End;		{ GetSnaps }

 Enjoy,

Raymond

Link to comment

There is probably not a GetConstraint because you can use PushAttrs to save all of the attributes and constraints and then restore them using PopAttrs when you are done.

 

Use those at the begining and end of your script and you can change things as you like while the script runs and give the user back their environment just as you got it.

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