VBA : placing fence

Hi all,

To get more efficient job, i'll try to place fence for printing within automated VBA code.

So the idea is to get ID of rectangulare element, or coord of it's extrem points, and place fence upon it.

macro will do the rest of job, parametring and printing.

 

But i don't know how to place fence with Element ID or even it's possible !

 

Do someone know something about that ?

 

 

PS : My job requires me to use only the default model, even when my draw is on many pages ....

Parents
  • damn ! it seems to be exactly what i try. but im my society, i can't install anything on computer, i'm french and appli must be in french....

    i'll post my first try code next.

    here's a part of my code

     

     

        Dim oElement        As Element

        Dim oFence          As Fence

        Dim myView          As View

    ...
    ...
    ...
            Set oFence = ActiveDesignFile.Fence
            oFence.Undefine
            Set oElement = oEnumerator.Current
            Set myView = CommandState.LastView
            'Set oFence = oFence.DefineFromElement(myView, oElement)
            oFence = ActiveDesignFile.Fence.DefineFromElement(myView, oElement)
            
            oFence.Draw
            MsgBox "Clôture placé sur élément ID=" & CStr(oID) & ". fin"
    i don't understand, i fount à lot of working exemple but my code won't work !!
    With DefineFromElement i get a "compilation error, function or var ..."
    i try
    oFence = oFence.Define....
    oFence.Define ....
    Set oFence = ActiveDesignFile.Fence.Define ...
    without succes !
    ps : what's the use for  of myView ?

     

  • Take a look at Print Organizer in V8xm. I believe it will do what you want without having to a vba. At least I believe Print Orgainzer is in XM it is in V8i. Print Organizer will place a fence prior to printing and it works great!

    Hopefully this helps,

    Roland (another french men)

    Roland

    V8i SS4 v.08.11.09,829
    AECOsim BD V8i

     

Reply Children
No Data