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

trying to flip dynamic block , doesn't work.

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
ButterFlyShame
497 Views, 2 Replies

trying to flip dynamic block , doesn't work.

Gentlemen, Could somebody take a look at this . Why I can't change the value of flip. It doesn't work.

  Public Sub vns_Change_Visual_Dyn_Blk_FlipIt(ByVal MyobjId As ObjectId)
        Dim mydwg As Document = Application.DocumentManager.MdiActiveDocument
        Dim MYed As Editor = mydwg.Editor
        Dim myDB As Database = mydwg.Database

        Using Tr As Transaction = myDB.TransactionManager.StartTransaction()
            Dim mydbObj As DBObject = Tr.GetObject(MyobjId, OpenMode.ForRead)
            If TypeOf mydbObj Is BlockReference Then
                Dim myBR As BlockReference = CType(Tr.GetObject(MyobjId, OpenMode.ForRead), BlockReference)
                Dim myBTR As BlockTableRecord = DirectCast(Tr.GetObject(myBR.DynamicBlockTableRecord, OpenMode.ForWrite), BlockTableRecord)
                Dim myBRC As DynamicBlockReferencePropertyCollection = myBR.DynamicBlockReferencePropertyCollection
                Try
                    For Each myBRP As DynamicBlockReferenceProperty In myBRC
                        Select Case myBRP.PropertyName
                            Case "Flip state1"
                                myBRP.Value = 1
                            Case Else

                        End Select
                    Next
                Catch ex As Exception
                    MsgBox("ERROR IN SET PARAMS TO DYN BLOCK " & ex.Message)
                End Try
            End If
            Tr.Commit()
        End Using
    End Sub

 

2 REPLIES 2
Message 2 of 3
Jeffrey_H
in reply to: ButterFlyShame

Try changing

myBRP.Value = 1

to

myBRP.Value = CShort(1)
You can also find your answers @ TheSwamp
Message 3 of 3
ButterFlyShame
in reply to: Jeffrey_H

Jeffrey,

It works Perfect . Thanks .

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