- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @dypro. The 'data type' of any 'custom' iProperty is simply set by what 'data type' you set as its value. And to change the 'data type' of an existing iProperty's value, you can simply set a new value to it that is pre-defined as the data type you want it to be. In this case, since we are copying data from an AutoCADBlock, each value we get from that source is already a String, but if you know which specific ones need to be understood as another data type, we can use 'data type conversion' techniques to accomplish that. I will post a few related links below that will be informative in this matter. You should be able to use something like 'CDate(sStringDateData)' to convert a String which represents Date type data into a Date type Data, either before we set it as the value of the iProperty, or as we are setting it as the value of the iProperty. How the Date data is formatted is another matter. That is usually handled automatically, and has something to do with your local 'culture' settings in your computer. But you can use certain methods to customize how Date type data is formatted, if it is still a problem after you try the data type conversion technique mentioned above.
https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/data-types/date-data-type
https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings
Here is an example you can try out, within your code.
Case "SH_DATE_DESS"
Dim dCreationDate As Date = CDate(sValue)
Try : oCProp = oCProps.Item("FECHA CREACION")
Catch : oCProp = oCProps.Add(dCreationDate, "FECHA CREACION") : End Try
If oCProp.Value <> dCreationDate Then Try : oCProp.Value = dCreationDate : Catch : End Try
And you can change the color of a drawing sheet, but I don't think you can change them individually. The setting is in the 'Document Settings', so that setting will effect all sheets, not just one sheet. That setting can be reached by code too, if you need to. (DrawingDocument.SheetSettings & SheetSettings.SheetColor )
Wesley Crihfield
(Not an Autodesk Employee)