Author Topic: Match orientation to layout  (Read 2594 times)

0 Members and 1 Guest are viewing this topic.

UWPMVG

  • Mosquito
  • Posts: 17
Match orientation to layout
« on: September 22, 2011, 05:17:17 AM »
Is it possible to change the "match orientation to layout" to TRUE for existing blocks in AutoCAD using VB.NET?

I have managed to change existing blocks to annotative using: btr.Annotative = AnnotativeStates.True

I've searched everywhere for an answer. Please help!

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Re: Match orientation to layout
« Reply #1 on: September 22, 2011, 06:01:29 AM »
Isn't it a property of a block definition? Not a block property but from the definition.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

UWPMVG

  • Mosquito
  • Posts: 17
Re: Match orientation to layout
« Reply #2 on: September 22, 2011, 06:24:27 AM »
Does that mean that I can't change it afterwards and therefore need to redefine the block?

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Re: Match orientation to layout
« Reply #3 on: September 22, 2011, 07:14:09 AM »
It is not a property which you can change per block. So yes, change it in the definition.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

UWPMVG

  • Mosquito
  • Posts: 17
Re: Match orientation to layout
« Reply #4 on: September 22, 2011, 08:49:45 AM »
Do you have any idea how that is done? I want all blocks with a specific name in the drawing to match the layout orientation.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Match orientation to layout
« Reply #5 on: September 22, 2011, 02:32:30 PM »
You can check the block's PaperOrientation enum value which is read-only but use  the DBObject.SetPaperOrientation Method which a BlockTableRecord is a DBObject
 
Here is a example showing both members for changing  "match orientation to layout" to TRUE for a block named 'C'
 
You might need to Regen for changes to show up
 
Code: [Select]
        <CommandMethod("ChangePaperOreintation")> _
        Public Sub ChangePaperOreintation()

            Dim doc As Document = Application.DocumentManager.MdiActiveDocument
            Dim db As Database = doc.Database
            Dim ed As Editor = doc.Editor
 
            Using trx As Transaction = db.TransactionManager.StartTransaction()

                Dim bt As BlockTable = trx.GetObject(db.BlockTableId, OpenMode.ForRead)
 
                If bt.Has("C") Then
                    Dim btr As BlockTableRecord = trx.GetObject(bt("C"), OpenMode.ForRead)
 
                    If btr.PaperOrientation = PaperOrientationStates.False Then
                        btr.UpgradeOpen()
                        btr.SetPaperOrientation(True)
                    End If
 
                End If
 
                trx.Commit()
            End Using
        End Sub

 

UWPMVG

  • Mosquito
  • Posts: 17
Re: Match orientation to layout
« Reply #6 on: September 23, 2011, 02:01:53 AM »
Thank you very much!!!! My application now works as I wanted to.