Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get/Set iProperty directly with Id Enum

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
FRPT1257
2696 Views, 5 Replies

Get/Set iProperty directly with Id Enum

It is possible get/set a iPropety value directly using the Id Enum.

 

Here can I get same C# sample.

 

Thanks & regards,

Rui

5 REPLIES 5
Message 2 of 6
rjay75
in reply to: FRPT1257

What ID enum are you refering too? Can you give a snippet of how you would like to refer to an iProperty?

Message 3 of 6
FRPT1257
in reply to: rjay75

What I want is an direct way in C# to get/set the value of a iProperty.

 

Not just for the main document but for the referenced documents too.

 

Follow the table with the list of iProperties with ProtertyName/Id/Id Enum.

 

 

Inventor User Defined Properties,

{D5CDD505-2E9C-101B-9397-08002B2CF9AE}

Inventor Summary Information,

{F29F85E0-4FF9-1068-AB91-08002B27B3D9}

Property Name

Id

Id Enum

Type

Title

2

kTitleSummaryInformation

String

Subject

3

kSubjectSummaryInformation

String

Author

4

kAuthorSummaryInformation

String

Keywords

5

kKeywordsSummaryInformation

String

Comments

6

kCommentsSummaryInformation

String

Last Saved By

8

kLastSavedBySummaryInformation

String

Revision Number

9

kRevisionSummaryInformation

String

Thumbnail

17

kThumbnailSummaryInformation

IPictureDisp

Inventor Document Summary Information,

{D5CDD502-2E9C-101B-9397-08002B2CF9AE}

Property Name

Id

Id Enum

Type

Category

2

kCategoryDocSummaryInformation

String

Manager

14

kManagerDocSummaryInformation

String

Company

15

kCompanyDocSummaryInformation

String

Design Tracking Properties,

{32853F0F-3444-11D1-9E93-0060B03C1CA6}

Property Name

Id

Id Enum

Type

Creation Time

4

kCreationDateDesignTrackingProperties

Date

Part Number

5

kPartNumberDesignTrackingProperties

String

Project

7

kProjectDesignTrackingProperties

String

Cost Center

9

kCostCenterDesignTrackingProperties

String

Checked By

10

kCheckedByDesignTrackingProperties

String

Date Checked

11

kDateCheckedDesignTrackingProperties

Date

Engr Approved By

12

kEngrApprovedByDesignTrackingProperties

String

Engr Date Approved

13

kDateEngrApprovedDesignTrackingProperties

Date

User Status

17

kUserStatusDesignTrackingProperties

String

Material

20

kMaterialDesignTrackingProperties

String

Part Property Revision Id

21

kPartPropRevIdDesignTrackingProperties

String

Catalog Web Link

23

kCatalogWebLinkDesignTrackingProperties

String

Part Icon

28

kPartIconDesignTrackingProperties

IPictureDisp

Description

29

kDescriptionDesignTrackingProperties

String

Vendor

30

kVendorDesignTrackingProperties

String

Document SubType

31

kDocSubTypeDesignTrackingProperties

String

Document SubType Name

32

kDocSubTypeNameDesignTrackingProperties

String

Proxy Refresh Date

33

kProxyRefreshDateDesignTrackingProperties

Date

Mfg Approved By

34

kMfgApprovedByDesignTrackingProperties

String

Mfg Date Approved

35

kDateMfgApprovedDesignTrackingProperties

Date

Cost

36

kCostDesignTrackingProperties

Currency

Standard

37

kStandardDesignTrackingProperties

String

Design Status

40

kDesignStatusDesignTrackingProperties

Long

Designer

41

kDesignerDesignTrackingProperties

String

Engineer

42

kEngineerDesignTrackingProperties

String

Authority

43

kAuthorityDesignTrackingProperties

String

Parameterized Template

44

kParameterizedTemplateDesignTrackingProperties

Boolean

Template Row

45

kTemplateRowDesignTrackingProperties

String

External Property Revision Id

46

kExternalPropRevIdDesignTrackingProperties

String

Standard Revision

47

kStandardRevisionDesignTrackingProperties

String

Manufacturer

48

kManufacturerDesignTrackingProperties

String

Standards Organization

49

kStandardsOrganizationDesignTrackingProperties

String

Language

50

kLanguageDesignTrackingProperties

String

Defer Updates

51

kDrawingDeferUpdateDesignTrackingProperties

Boolean

Size Designation

52

String

Categories

56

kCategoriesDesignTrackingProperties

String

Stock Number

55

kStockNumberDesignTrackingProperties

String

Weld Material

57

kWeldMaterialDesignTrackingProperties

String

Message 4 of 6
rjay75
in reply to: FRPT1257

To use the propId the most straight forward way will be 

 

doc.PropertySets[name / index].ItemByPropId(propId)

 

where doc a document object.

Message 5 of 6
FRPT1257
in reply to: rjay75

It is possible get the type of the property? If is String, Date, IPictureDispLong, Currency or Boolean?

 

Apparently the "Property.Type() As ObjectTypeEnum" returns always "kPropertyObject" and not if is String, Date, IPictureDispLong, Currency or Boolean

Message 6 of 6
rjay75
in reply to: FRPT1257

Simplest way to get the type of the value is to test if the Property.value is not null, then get the result of the GetType .NET method. This will return the .NET type of the value.

 

Property.Value.GetType()

 

 

You still want to know what property you are refering to because it may be a calculater result in which you need to use Property.Expression to get the expression calulation since the Value will just be the result.

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

Post to forums  

Autodesk Design & Make Report