Save custom CPlane(s)

Next
 From:  Mindset (IGNITER)
10744.1 
Hey Everyone !

Can we save custom CPlane(s), globally or in the model?

Thanks ,
MindSet
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10744.2 In reply to 10744.1 
Hi MindSet, sorry no there isn't anything set up for that currently. Probably the best way currently would be to make a plane object or 2 perpendicular lines for the cplane location that you want to save.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Mindset (IGNITER)
10744.3 In reply to 10744.2 
Maybe set this as a wish-list item ?

Thank You Michael !
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Larry Fahnoe (FAHNOE)
10744.4 In reply to 10744.3 
Hi MindSet,

Although I've not looked into writing the script, you might consider looking at the View Manager script https://moi3d.com/forum/index.php?webtag=MOI&msg=10028.31 as the basis for something to accomplish what you're asking for. Teddy took a unique approach to saving the additional information needed as a .views.json file, so not a global setting but unique to the file.

--Larry
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Mindset (IGNITER)
10744.5 In reply to 10744.4 
Thank you Larry,
Appreciate it Sir.

MindSet
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Larry Fahnoe (FAHNOE)
10744.6 In reply to 10744.5 
Hi MindSet,

Dusting off my earlier tinkering with setting a CPlane via a script, the only means that I'm aware of to create a CPlane is moi.view.setCPlaneInteractive() which, as its name implies, brings up the CPlane dialog. So, not really a means of creating a CPlane from some previously stored information. There may be other functions available, I'm just not aware of them.

--Larry
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10744.7 In reply to 10744.6 
Hi Larry, scripting interface for cplanes is as follows:

moi.view.setCPlane( Frame, ApplyToAllViews, OrientOrthoViews ); - takes a required coordinate frame parameter, optional boolean parameter for whether to apply to all views or 3d view only, and optional boolean parameter for whether to orient ortho views or keep them in world.

moi.view.getCPlane(); - returns coordinate frame for the active cplane.

moi.view.setCPlaneInteractive(); - runs the user interactive method for setting the cplane same as pushing the View > CPlane button.

moi.view.resetCPlane(); - sets the current cplane to world.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
10744.8 In reply to 10744.6 
In the Elastica2 and Clothoid scripts, pointpicker is used to get cplane.
I think that this is true.
From Michael's help from 2013.

var pointpicker = moi.ui.createPointPicker();
if ( !GetPoint( pointpicker ) ) return;
var cplane = pointpicker.ptframe;

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Mindset (IGNITER)
10744.9 In reply to 10744.4 
Thanks Larry,

It's still a challenge because the script stores views but not CPlane(s).
I tried to store data from "moi.view.getCPlane();" into the Jason file, but I don't know its properties nor how to work with them to restore it from the subsequently retrieved data.

It would be nice if we could store CPlanes as construction planes (unprintable..? objects) within the .3dm file!

Any hints, anyone?
- Mindset
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
10744.10 In reply to 10744.9 
Hi Mindset,

re:
> I tried to store data from "moi.view.getCPlane();" into the Jason file, but I don't know its properties

The return from moi.view.getCPlane() is a coordinate frame object, it has properties for: .origin, .xaxis, .yaxis, and .zaxis , and each of those points and vectors have properties for .x .y and .z .

When you want to make a coordinate frame object, you call moi.vectorMath.createFrame() and on the coordinate frame you can set it using the .set() method which takes 9 values: frame.set( originx, originy, originz, xaxisx, xaxisy, xaxisz, yaxisx, yaxisy, yaxisz ); - the z axis is automatically calculated from the x and y axes and isn't set by itself.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All