////////////////////////////////////////////////////////////////////////////// // // Copyright 2026 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software. // ////////////////////////////////////////////////////////////////////////////// #pragma once #include "../Features/Feature.h" #include #include // THIS CLASS WILL BE VISIBLE TO AN API CLIENT. // THIS HEADER FILE WILL BE GENERATED FROM NIDL. #include #ifdef FUSIONXINTERFACE_EXPORTS # ifdef __COMPILING_ADSK_FUSION_ARRANGEFEATURE_CPP__ # define ADSK_FUSION_ARRANGEFEATURE_API XI_EXPORT # else # define ADSK_FUSION_ARRANGEFEATURE_API # endif #else # define ADSK_FUSION_ARRANGEFEATURE_API XI_IMPORT #endif namespace adsk { namespace fusion { class ArrangeComponent; class ArrangeComponents; class ArrangeDefinition; class ArrangeEnvelopeDefinition; class ArrangeResultEnvelopes; class Occurrence; }} namespace adsk { namespace fusion { /// Represents an Arrange feature within a component. class ArrangeFeature : public Feature { public: /// Returns a definition object that provides access to the information defining this arrange /// feature and provides access to the resulting arrangement of occurrences. /// /// To use this property, you need to position the timeline marker immediately before the Arrange feature. /// This can be accomplished using the following code: arrangeFeature.timelineObject.rollTo(True) core::Ptr definition() const; /// Returns the collection of ArrangeComponent objects that are being arranged. /// /// To use this property, you need to position the timeline marker immediately before the Arrange feature. /// This can be accomplished using the following code: arrangeFeature.timelineObject.rollTo(True) core::Ptr arrangeComponents() const; /// Returns the envelope definition associated with this arrangement. /// /// To use this property, you need to position the timeline marker immediately before the Arrange feature. /// This can be accomplished using the following code: arrangeFeature.timelineObject.rollTo(True) core::Ptr envelopeDefinition() const; /// Returns the resulting envelopes and their contents. core::Ptr resultEnvelopes() const; /// Returns an array of ArrangeComponent objects that did not fit in the arrangement. This is /// most useful in the case where partial arrange has been enabled, which means some /// components may have been arranged and others were left out. /// /// To use this property, you need to position the timeline marker immediately before the Arrange feature. /// This can be accomplished using the following code: arrangeFeature.timelineObject.rollTo(True) std::vector> unusedComponents() const; /// The NativeObject is the object outside the context of an assembly and /// in the context of its parent component. /// Returns null in the case where this object is not in the context of /// an assembly but is already the native object. core::Ptr nativeObject() const; /// Creates or returns a proxy for the native object /// - i.e. a new object that represents this object but adds the assembly context /// defined by the input occurrence. /// occurrence : The occurrence that defines the context to create the proxy in. /// Returns the proxy object or null if this isn't the NativeObject. core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; /// Returns statistics about the arrangement in JSON format as a string. Each item in the JSON is identified with its English name, /// and the current localized name is also provided. The values follow the API rules, where all length values are in centimeters, /// and areas are in square centimeters. The returned JSON may include additional values in the future, so code consuming this /// output should be tolerant of new fields. /// /// Returns an empty string in the case it failed to get any statistics. std::string arrangeStatistics() const; ADSK_FUSION_ARRANGEFEATURE_API static const char* classType(); ADSK_FUSION_ARRANGEFEATURE_API const char* objectType() const override; ADSK_FUSION_ARRANGEFEATURE_API void* queryInterface(const char* id) const override; ADSK_FUSION_ARRANGEFEATURE_API static const char* interfaceId() { return classType(); } private: // Raw interface virtual ArrangeDefinition* definition_raw() const = 0; virtual ArrangeComponents* arrangeComponents_raw() const = 0; virtual ArrangeEnvelopeDefinition* envelopeDefinition_raw() const = 0; virtual ArrangeResultEnvelopes* resultEnvelopes_raw() const = 0; virtual ArrangeComponent** unusedComponents_raw(size_t& return_size) const = 0; virtual ArrangeFeature* nativeObject_raw() const = 0; virtual ArrangeFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; virtual char* arrangeStatistics_raw() const = 0; }; // Inline wrappers inline core::Ptr ArrangeFeature::definition() const { core::Ptr res = definition_raw(); return res; } inline core::Ptr ArrangeFeature::arrangeComponents() const { core::Ptr res = arrangeComponents_raw(); return res; } inline core::Ptr ArrangeFeature::envelopeDefinition() const { core::Ptr res = envelopeDefinition_raw(); return res; } inline core::Ptr ArrangeFeature::resultEnvelopes() const { core::Ptr res = resultEnvelopes_raw(); return res; } inline std::vector> ArrangeFeature::unusedComponents() const { std::vector> res; size_t s; ArrangeComponent** p= unusedComponents_raw(s); if(p) { res.assign(p, p+s); core::DeallocateArray(p); } return res; } inline core::Ptr ArrangeFeature::nativeObject() const { core::Ptr res = nativeObject_raw(); return res; } inline core::Ptr ArrangeFeature::createForAssemblyContext(const core::Ptr& occurrence) const { core::Ptr res = createForAssemblyContext_raw(occurrence.get()); return res; } inline std::string ArrangeFeature::arrangeStatistics() const { std::string res; char* p= arrangeStatistics_raw(); if (p) { res = p; core::DeallocateArray(p); } return res; } }// namespace fusion }// namespace adsk #undef ADSK_FUSION_ARRANGEFEATURE_API