CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedProblem updating dynamic block user parameters

 Post Reply Post Reply
Author
kinggi View Drop Down
Newbie
Newbie


Joined: 23.Nov.2010
Location: Australia
Using: AutoCAD2010
Status: Offline
Points: 1
Direct Link To This Post Topic: Problem updating dynamic block user parameters
    Posted: 23.Nov.2010 at 13:03
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
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,148 seconds.