.NET

Reply
Active Contributor
Posts: 40
Registered: ‎06-03-2003
Message 1 of 4 (511 Views)
Accepted Solution

Dynamic block parameters types

511 Views, 3 Replies
08-08-2012 02:33 AM

 

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

DynamicBlock Property

 

ROTATIONPARAMETERENTITY,  LINEARPARAMETERENTITY or POLARPARAMETERENTITY

 

Distinguished Contributor
khoa.ho
Posts: 136
Registered: ‎09-15-2011
Message 2 of 4 (500 Views)

Re: Dynamic block parameters types

08-08-2012 09:06 AM in reply to: humberto

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

Active Contributor
Posts: 40
Registered: ‎06-03-2003
Message 3 of 4 (467 Views)

Re: Dynamic block parameters types

08-08-2012 11:11 PM in reply to: khoa.ho

Thanks Khoa

Distinguished Contributor
khoa.ho
Posts: 136
Registered: ‎09-15-2011
Message 4 of 4 (456 Views)

Re: Dynamic block parameters types

08-09-2012 01:27 PM in reply to: humberto

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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community