Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: [CONNECT] How To Assign ItemType Values

$
0
0
                ItemType item = ItemTypesHelper.GetItemType(name, library);
                if (item == null)
                    return;

                CustomItemHost itemHost = new CustomItemHost(elementToTag, false);
                IDgnECInstance appliedItem = itemHost.ApplyCustomItem(item);
              


                    IECPropertyValue property = appliedItem.GetPropertyValue(attribute.Name);
                    if (property == null)
                        continue;
                    
                    switch (attribute.AttributeType)
                    {
                        case GisAttribute.Type.String:
                            property.StringValue = selectedValue;
                            break;
                        case GisAttribute.Type.Double:
                            property.DoubleValue = selectedValue.ToDouble();
                            break;
                        case GisAttribute.Type.Integer:
                            property.IntValue = selectedValue.ToInt();
                            break;
                        default:
                            throw new ArgumentOutOfRangeException();
                    }

                    appliedItem.WriteChanges();

Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>