Factory Design Utilities Forum
Welcome to Autodesk’s Factory Design Utilities Forums. Share your knowledge, ask questions, and explore popular Factory Design Utilities topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Instance Number

29 REPLIES 29
Reply
Message 1 of 30
mk92
2229 Views, 29 Replies

Instance Number

Hello,

 

is there a way to get the instance number in any form? If i export my attributes in FDS 2016 i get a cell with the instance id. Is there a way to write this in a ipropertie or in a parameter? I need them to show in my BOM.

 

Regards

29 REPLIES 29
Message 2 of 30
olegd.prod
in reply to: mk92

If you place 2 (or more) instances of the same asset into a layout, you'll have different instance IDs, but all they will share the underlying file that represents the asset.
Since there are multiple instances sharing the same file, Instance ID can't be written to an iProperty/parameter in the file ...

Can you help me understand what are you trying to achieve (why do you want the instance ID in the BOM)?
Message 3 of 30
mk92
in reply to: olegd.prod

We need them to differentiate between the different asset variants (different configurations/parameter etc). To import them in our system we need the instance id to check if this id still exists or not . So we need the ID in the BOM.

 

The other way would be to customize the way the attributes are exported because this contains an export of the ID.

Message 4 of 30
olegd.prod
in reply to: mk92

differentiate between the different asset variants (different configurations/parameter etc): this should help you: https://knowledge.autodesk.com/support/factory-design-suite/learn-explore/caas/CloudHelp/cloudhelp/2...

BOM cannot contain instance IDs, since the BOM isn't a per-instance document. If you need to check if an instance ID exists, you'd have to process the results of the property export (which you found already)
Message 5 of 30
mk92
in reply to: olegd.prod

Is there a way customize the result of property export ? Like an extra gap for user parameter?

Message 6 of 30
olegd.prod
in reply to: mk92

Unfortunately not possible today 😞
Message 7 of 30
mk92
in reply to: olegd.prod

So everything in the property export is an iPropertie except the instance id. Thats not good for me 😄 So there really is nothing, no iLogic code or anything to help me with this problem?

Message 8 of 30
olegd.prod
in reply to: mk92

If you goal is to examine the list of instances - that is available in the property export.
If your goal is to include the instance ID in the BOM - no, there is no way to do that.
Message 9 of 30
mk92
in reply to: olegd.prod

Okay.

 

Another question: What do you mean in post 5?

https://forums.autodesk.com/t5/factory-design-suite-general/fds-api/td-p/4842767

 

 

 

Message 10 of 30
olegd.prod
in reply to: mk92

We expose a very limited set of APIs to get and set instance properties.
The "get" APIs can be used to get the data you see in the property export report
Message 11 of 30
mk92
in reply to: mk92

So if i dont get anything wrong this is what i need? But it isnt ready yet oder can i get this information?
Message 12 of 30
olegd.prod
in reply to: mk92

You can certainly get this info - below. Let me know if you run into any problems.

You'd need to reference the Autodesk.Factory.PublicAPI .NET assembly.
Code would look something like this:
using Autodesk.Factory.PublicAPI;

var instances = API.Instance.GetAssetInstancesFromLayout(Inventor.Document object of the layout);
each instance looks like this:
public interface IAssetInstance
{
string InstanceID { get; }
string InstanceName { get; }
IInstanceProperty[] InstanceProperties { get; }
object NativeObject { get; }
}

Each property looks like this:
public interface IInstanceProperty
{
String Name { get; }
String Category { get; }
String Value { get; }
bool EditableByUser { get; }
PropertyDataType DataType { get; }

}
Message 13 of 30
XuesongBai
in reply to: mk92

Hi there,

 

Which FDS version are you using now? I have checked the Properties Export in FDS 2016 and the Instnace ID is included in the Excel report.

 

Thanks,

-Xuesong

Please mark as a solution if somehow I got it right.
Message 14 of 30
AnJanson
in reply to: olegd.prod

Hi,

I played around with the API and was able to read the asset properties.

But, I tried to change a asset property by using the SetInstanceProperty command.

It seems to work and I can see the new value for this property, but the asset does not update.

Is there any possibility to change the properties of an asset through the API?

Regards Andreas

Message 15 of 30
olegd.prod
in reply to: AnJanson

What does "but the asset does not update" mean? How are you testing that?

Oleg
Message 16 of 30
AnJanson
in reply to: olegd.prod

Hi Oleg,

 

sorry for the late response.

I tested it with iLogic from the layout document. I tried to duplicate it again and now it works.

 

AddReference "Autodesk.Factory.PublicAPI"
Imports Autodesk.Factory.PublicAPI

Dim instances() As Currency.IAssetInstance = API.Instance.GetAssetInstancesFromLayout(ThisDoc.Document)

If instances.length > 0 Then
  Dim asset As Autodesk.Factory.PublicAPI.Currency.IAssetInstance = instances(0)
  Dim prop1 As Currency.IInstanceProperty = API.Instance.SetInstanceProperty(asset,"Test", 123)
  MessageBox.Show(prop1.Name & " = " & prop1.Value, "")
Else
  MessageBox.Show("No assets in layout", "")
End If

Is there any possibility to modify the asset parameters?

 

Regards

Andreas

Message 17 of 30
olegd.prod
in reply to: AnJanson

Hi Andreas,
Glad to hear this is working for you.
No API support yet for changing parameters. Can you elaborate on what you are trying to do (what would you do if you could change parameters)?

Oleg
Message 18 of 30
wezpb
in reply to: AnJanson

Do you have a version of this code that will work in VBA?

Message 19 of 30
olegd.prod
in reply to: wezpb

Hi there,
The API is .NET-only, no VBA support

Thank you,

Oleg
Message 20 of 30
petestrycharske
in reply to: mk92

mk92,

 

Good afternoon!  What if you set up some iLogic code to write your own unique ID (as a custom iProperty) on a project  by project basis.  You could pull in a job code or assembly code from the parent assembly and add that to some simple counting routine.  That way any time that you added a different instance of the of the asset, your counter would increase by one.  Not super sophisticated, but might be able to help out.  Let me know if this would be of some benefit to you.  Hope this helps and have a most blessed day!

 

Peace,

Pete

Just a guy on a couch...

Please give a kudos if helpful and mark as a solution if somehow I got it right.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report