Hi!
I have created a property set that I have attached to a Block Reference, in this property set I have a Automatic Property Definition that reads the Block Name.
So far everything looks good.
But if I have a block with a defined action e.g.. Stretch and when I use the action for the first time the blockname changes to e.g.. *U81.
I´m not a programmer but I did some LISP in the past and if I remember right you had to get the fingers on "effective name" to be sure that you get the original block name...
So my guess is that the Name property not reads the effective name or original block name or what you call it
Is this the way it supposed to behave?
Anyone that can give a solution for this?
I need to evaluate the original blockname and depending on the name I will set a value in the property set...see below
Select Case "[BlockName]";;;Gives me the Blockname
Case "01"
RESULT="Dörrläsare";;;Sets a value depending on the blockname (Swedish)
Case "02"
RESULT="Larmad port"
Case "03"
RESULT="Glaskross"
Case "04"
RESULT="IR-Detektor"
Case "05"
RESULT="Huvudentré"
Case "06"
RESULT="DS-Larm"
Case "07"
RESULT="Nödnyckel"
Case "08_"
RESULT="Securitaslarm"
Case Else
RESULT="Unknown block"
End Select
Solved! Go to Solution.
Solved by David_W_Koch. Go to Solution.
You can get to the EffectiveName by using a formula property.
First, you will need to add an automatic property referencing the ObjectID automatic property source. This will be used in the formula property to access the object to which the Property Set is attached.
Then, you can set up a formula property with the following formula, where [ObjectID] is a properly created property reference to the automatic property just created:
set acadApp = GetObject(,"AutoCAD.Application")
set obj = acadApp.ActiveDocument.ObjectIDToObject( [ObjectID] )
RESULT = obj.EffectiveName
If you need a property that indicates whether or not the block is a dynamic block, you can create another formula property using this formula, which will have a value of TRUE if it is a dynamic block or FALSE if it is not, and can be used as the condition of an IF statement:
set acadApp = GetObject(,"AutoCAD.Application")
set obj = acadApp.ActiveDocument.ObjectIDToObject( [ObjectID] )
RESULT = obj.IsDynamicBlock