xclip with vba

Discussion in 'AutoCAD' started by Tony Yang, Jun 18, 2004.

  1. Tony Yang

    Tony Yang Guest

    Hi, All.

    I like to use vba to do xclip and I wonder if anyone already done it. If so,
    how did you do it?

    Thanks,

    Tony Y.
     
    Tony Yang, Jun 18, 2004
    #1
  2. Tony Yang

    TomD Guest

    Have you tried using SendCommand? (Not ideal, but should work.)
     
    TomD, Jun 18, 2004
    #2
  3. Tony Yang

    Jackrabbit Guest

    [pre]
    Written in Delphi but...

    procedure ClipXRef(ThisDrawing: AcadDocument; View: TView);
    { There is no method provided in ActiveX Automation for clipping the boundaries
    of blocks and xrefs. Use the XCLIP command in AutoCAD, or send the XCLIP
    command to AutoCAD using the SendCommand method. }
    var
    CommandString: string;
    P1: string;
    P2: string;
    begin
    ThisDrawing.MSpace := True;

    P1 := FloatToStr(View.Corner1.X) + ',' + FloatToStr(View.Corner1.Y) + ' ';
    P2 := FloatToStr(View.Corner2.X) + ',' + FloatToStr(View.Corner2.Y) + ' ';

    CommandString := 'XCLIP ALL N Y R ' + P1 + P2;
    ThisDrawing.SendCommand(CommandString);

    ThisDrawing.MSpace := False;
    end;
    [/pre]
     
    Jackrabbit, Jun 18, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.