Jump to content

Problem when updating user parameters on dynamic block - 2010 gui not updated


kinggi

Recommended Posts

Hello,

 

I have some VBA code that updates specific parameters within a dynamic block (this occurs while the drawing file is open in autocad).

 

The code appears to run successfully and when looking in debug mode the new value of the parameter is successfully assigned and remains assigned, however in the autocad gui the drawing does not update, and even when going into the block editor the new values do not get shown. However, when performing various tasks and navingating through the gui it does at some point force a refresh and the drawing then reflects the changes.

 

I have tried adding block.update calls and thisdrawing.regen calls but there was no difference observed. There must be something I'm missing. Can someone help me out?

 

The guts of the code is:

 

For Each ent In ThisDrawing.ModelSpace

If ent.ObjectName = "AcDbBlockReference" Then

Set oBkRef = ent

If oBkRef.IsDynamicBlock = True Then 'Check if it is a dynamic block

v = oBkRef.GetDynamicBlockProperties 'Get all Dynamic attributes

If oBkRef.EffectiveName = Blockname Then

For I = LBound(v) To UBound(v)

Set oDynProp = v(I)

If Not IsArray(oDynProp.Value) Then 'Not an array

If oDynProp.PropertyName = Parametername Then

Str (oDynProp.Value)

oDynProp.Value = Newvalue 'Set the new value

End If

End If

Next

End If

End If

End If

Next ent

 

Thanks very much,

-Steve

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...