.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynamic block parameters types

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
humbertogo
2286 Views, 3 Replies

Dynamic block parameters types

 

Is there a way to know what kind parameter type is using in a

DynamicBlock Property

 

ROTATIONPARAMETERENTITY,  LINEARPARAMETERENTITY or POLARPARAMETERENTITY

 

3 REPLIES 3
Message 2 of 4
khoa.ho
in reply to: humbertogo

I can't see an enum type of DynamicBlockReferenceParameter in AutoCAD .NET API. It may be missing from the API?

 

The following code snippet is used to change properties of a dynamic block. We should know exactly the parameter name to find in DynamicBlockReferenceProperty.PropertyName. We can find this name by checking the Properties pane of a dynamic block in AutoCAD. Just use AutoCAD to see all parameter names of a dynamic block to use in code.

 

DynamicBlockReferencePropertyCollection properties = blockReference.DynamicBlockReferencePropertyCollection;
for (int i = 0; i < properties.Count; i++)
{
    DynamicBlockReferenceProperty property = properties[i];
    if (property.PropertyName == "Position X")
    {
        property.Value = newValue;
    }
}

 

I would like the class DynamicBlockReferenceProperty to have a new property named PropertyType that is an enum of all dynamic block parameters. So it will help developers to work easier without knowing PropertyName string and PropertyTypeCode number, that are not strong-typed and intuitive.

 

-Khoa

Message 3 of 4
humbertogo
in reply to: khoa.ho

Thanks Khoa

Message 4 of 4
khoa.ho
in reply to: humbertogo

You are welcome. I am happy that the answer met your question. I hope the future AutoCAD .NET API will have more convenient options to work with dynamic blocks.

 

-Khoa

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost