I think "Component" is inclusive of pins. Therefore you want to obtain the SymbolBlock (from the component) and add properties to the SymbolBlock i.e. CVdBlock
What method you tried to add the attributes? Component.AddBatchAttributes would work for your case since your code is accessing Component Object.
If objComp.Type = VDTS_COMPONENT Then
objComp.AddBatchAttributes("0 1 testprop=any_value") ' 0 1 means 'invisible' & 'replace if already exists'
You may refer to DxDesigner Automation Reference(dxdesigner_auto.pdf) for detail about AddBatchAttributes method of Component object
I contacted Mentor and it is a known bug, there is also an DR/ER existing: 00725794
So there is no way to select the symbol exclusively without the pin.
I used the objComp.AddBatchAttributes("3 0 Ast Remark=" & NotFittedProperty & "")
There was an error in my first description, the error occurs if a symbol and a pin of the symbol is selected. Then the property will be added to the pin
How about unselecting all pins before performing add properties?
Set colPins = Application.Query(VDM_COMPPIN+VDM_PIN, VD_SELECTED)
If colPins.Count > 0 Then
For Each obj In colPins
obj.Selected = False
That really helped, I didn't think about that.