What is "nativeObject"?

What is "nativeObject"?

graham.wideman
Advocate Advocate
885 Views
3 Replies
Message 1 of 4

What is "nativeObject"?

graham.wideman
Advocate
Advocate

Quite a number of classes have a property "nativeObject", for which the API Reference says: 

The NativeObject is the object outside the context of an assembly and in the context of it's [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.

 

What does nativeObject mean here?  I can think of at least two possibilities:

1. nativeObject might refer to the top-level component within a Design.

2. nativeObject might refer to whether or not an object is "native to Fusion". That is to say, one composed from Fusion sketches and operations (features), as opposed to imported from some other system.

3. ... or something else?

 

Also, what is meant by:  the object outside the context of an assembly and in the context of its parent component.?

Surely in Fusion, an assembly is simple a component that has subsidiary components. (Considering a Design's top level in the browser to be an component.)  Which would make an assembly a "parent component".  Which would make this sentence nonsensical.  So I must be misunderstanding this.  (Hmm, maybe I'm not clear on whether "its" refers back to "an assembly", or "the object".)

 

Thanks.

 

 

 

886 Views
3 Replies
Replies (3)
Message 2 of 4

BrianEkins
Mentor
Mentor

Take a look at this topic in the help. It answers your question and explains a lot of the internals that are important to know when working with the API.

 

http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-88A4DB43-CFDD-4CFF-B124-7EE67915A07A

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 4

graham.wideman
Advocate
Advocate

Thanks Brian for pointing to that page, which I had seen before, but forgot talks about nativeObject.

I have made some progress, but am stuck on one significant point that's really the flip side of nativeObject: what exactly is a proxy?

 

That page, "Documents, Products, Components, Occurrences, and Proxies", indeed covers absolutely crucial territory, the top-level "skeleton" structure of F360 document data. It's pretty clear about the relationship between Occurrence and Component, and some other structure topics.

 

But working down the page, other topics get into a bit of a conceptual quagmire, introducing numerous vague terms without proper definition, in a haphazard fashion that makes it difficult to get traction. For example, "assembly", "instance", and "context" appear without introduction, ostensibly refer to different things, but I have concluded that they are all just casual synonyms for Occurrence, or at least for an Occurrence playing particular roles.

 

To the topic at hand: from the RedFace example (on the linked page), it appears that a proxy is subsidiary to an Occurrence, and represents an "actual" object subsidiary to that Occurrence's component.

And indeed, nativeObject is a property on objects that are usually subsidiary to a Component: Sketch and all the SketchXxx objects, all the xxxConstraint objects, all the XxxFeature objects, and the JointXxx objects, (and also Occurrence).

 

Ie: each of these objects that can be part of an "actual" Component, can alternatively act as a proxy for that type of object, which makes sense.

 

So where do these proxy objects appear in the object model?

 

I expected that there would be a collection of proxy objects contained in Occurrence. Indeed Occurrence does have property bRepBodies, a collection of bRepBody proxies for the bRepBody items in the component pointed to by Occurrence.component.

 

And the doc for a typical proxy-capable object says:  "SketchLine.assemblyContext Property Returns the assembly occurrence (i.e. the occurrence) of this object in an assembly. This is only valid in the case where this is acting as a proxy in an assembly. Returns null in the case where the object is not in the context of an assembly but is already the native object."

... which is very poorly worded, but seems to say that an object such as SketchLine can be subsidiary to an Occurrence.

 

But in the API Reference, I don't see any property on Occurrence that would contain a collection of proxy objects, nor method that could add or retrieve proxy objects. And such does not appear in the object model diagram either.

 

So, not seeing what object proxies would be attached to, my understanding of proxies is at an impasse!

0 Likes
Message 4 of 4

graham.wideman
Advocate
Advocate

On the basis that this thread really revolves around Proxies, I posted a more-focused question about that:

Where are Proxies in the object model? 

 

0 Likes