Class Reference layout3d

the main window of the 3d editor More...

Member

void addFunctionKey(int key,int function)
void addMacroKey(int key,string macroFileName, string title, string iconFileName)
void addMacroToolButton(string macroName,string parameter,string iconfilenam)
string filename
drawingField3d* drawing
void closeDesign()
string macroToolbarName

Detailed Description

graph LR classDef thisClas fill:#eaf5fc,stroke:#3c7faa,stroke-width:4px; classDef clas fill:#eaf5fc,stroke:#3c7faa,stroke-width:1px; la(layout3d)==drawing==>dr(drawingField3d) click la "/layoutscript/api/layout3d" click dr "/layoutscript/api/drawingfield3d" class la thisClas class dr clas

The layout3d object is the main window of the 3d editor, with the same role as layout for 2d. In a C++ macro you use the name layout3d; if no 3d window is open, one is created. The solid model lives in layout3d->drawing, a drawingField3d with cells and meshes. filename is the path of the loaded 3d file. Toolbar and extra-keyboard helpers match the 2d window. From a 2d layout you can also open a linked 3d window with project getLayout3d.

Example:

layout3d->filename = "/tmp/part.step";
layout3d->drawing->scaleFull();

Member Function Documentation


void layout3d::addFunctionKey(int key,int function)

Set the feature of an extra keyboard. key is the number of the key. It is numbered from 0 to the amount of keys the keyboard has. function is the feature code of the featur you want to add. As toolbutton, modification of the extra keyboard are not store and it is recommended to set it with an autostart macro. (introduced with release 20210905)


void layout3d::addMacroKey(int key,string macroFileName, string title, string iconFileName)

Assigns one key of an external keyboard to a macro. key is the key number. macroFileName is the full path of the macro, title the caption, and iconFileName the full path of the icon file. (introduced with release 20210910)

Parameter:
key key index on the extra keyboard
macroFileName full path of the macro file
title caption shown for the key
iconFileName full path of the icon file

void layout3d::addMacroToolButton(string macroName,string parameter,string iconfilenam)

Adds a button to the Macros toolbar (created if missing). macroName is the macro file. iconfilename is the icon; empty or missing uses the default. The button is not stored at shutdown; restore it from an autostart macro.

Parameter:
macroName macro file to run
parameter reserved; pass an empty string
iconfilenam path to the button icon

string layout3d::filename

The file name of the current displayed design.


drawingField3d* layout3d::drawing

Pointer to the 3d design, a drawingField3d.


void layout3d::closeDesign()

Closes the current displayed design.


string layout3d::macroToolbarName

Holds the name of the toolbar containing custom macros. The name must be set before the first macro is added to the toolbar. (introduced with release 20260628)