Tag: My First Plug-in
-
Lesson 4A: Convert script to an Add-in(C++/Python)
Python C++ After creating an add-in, we’ll have a project structure like below. Same as the script, they entry point is in the BasicAddin.py. Let’s take a look at it. # Assuming you have not changed the general structure of the template no modification is needed in this file. from . import commands from .lib…
-
Lesson 3: Create a shoebox
Python C++ Typescript @dataclass class BoxParameters: border_thickness : float bottom_thickness : float inner_width : float inner_length : float inner_height : float fillet_size : float def __init__(self, border_thickness: float, bottom_thickness:float, inner_width:float, inner_length:float, inner_height:float, fillet_size:float): self.border_thickness = border_thickness self.bottom_thickness = bottom_thickness self.inner_width = inner_width self.inner_length = inner_length self.inner_height = inner_height self.fillet_size = fillet_size typedef struct { double…
-
Lesson 2: Understand the document
#include <Fusion/Components/Component.h> // Get the value of the property. Ptr<Features> propertyValue = component_var->features(); std::string processProperty(const Ptr<Property>& property) { const char* propertyObjectType = property->objectType(); if (strcmp(IntegerProperty::classType(), propertyObjectType) == 0) return processIntegerProperty(property); if (strcmp(StringProperty::classType(), propertyObjectType) == 0) return processStringProperty(property); if (strcmp(BooleanProperty::classType(), propertyObjectType) == 0) return processBooleanProperty(property); if (strcmp(FloatProperty::classType(), propertyObjectType) == 0) return processFloatProperty(property); if (strcmp(ChoiceProperty::classType(), propertyObjectType) ==…
-
Lesson 1: The basic scripts and Add-in
Python/C++ Typescript 1. Launch Fusion, find utilities and click at the drop menu of ADD-INS button. You can find Scripts and Add-ins menu item. 2. Click at it, in the new window, we can create two types of add-ins: Scripts and Add-ins. There isn’t much different between them technically. The script will run at once…

You must be logged in to post a comment.