It is possible get/set a iPropety value directly using the Id Enum.
Here can I get same C# sample.
Thanks & regards,
Rui
Solved! Go to Solution.
Solved by rjay75. Go to Solution.
Solved by rjay75. Go to Solution.
What ID enum are you refering too? Can you give a snippet of how you would like to refer to an iProperty?
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 |
To use the propId the most straight forward way will be
doc.PropertySets[name / index].ItemByPropId(propId)
where doc a document object.
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
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.