pasting excel into Brics

Does anyone know how Brics decides where its going to paste a copied excel sheet? Its seems random and based on screen size, but i cant make heads or tails of it. I need to find out where it is on the screen for my vba scripting.

Comments

  • Roy Klein Gebbinck
    edited October 2017

    The OLE object seems to be positioned relative to the top left corner of the CAD window. Why don't you check the InsertionPoint property of the OLE object?

  • A few years back, I had an extensive discussion here, about ways to embed an Excel spreadsheet, in hopes of finding a way to do so that would both preserve the original formatting, and not look pixelated. I never found a good way to do it on my v14. So, I now just import into a table using the table creation dialog box, and accept the different formatting, and extra labor involved in adjusting the spreadsheet.

    -Joe

  • @jaekma:
    What is your experience with the print quality of Excel OLE objects in BricsCAD?

  • Roy, I know your question was directed to jaekma, but to add my experience. v14 definitely upped the quality so that my Excel OLEs were readable, but they still looked pixelated on our D-sized paper. However, file sized jumped so much, that I had to abandon the practice even if the pixelation was not an issue. The root cause was that these objects are raster images.

    I am curious if the current version also has Excel OLEs as a raster object? I suppose the only ideal solution would be if Tables were sophisticated enough to carry more of the formatting available in Excel, and then convert the Excel into a Table, as it is being pasted. But, this would depend upon whatever features Autodesk has put into Tables.

    -Joe

  • Terry Dotson
    edited October 2017

    For the simplest of spreadsheets, the table object comes close. However the table object will never be able to adequately represent the contents of a complex Excel spreadsheet.

    Graphic Example

    XL2CAD Add-On for BricsCAD

  • Terry, what sort of object/entities does your utility create?

    -Joe

  • LwPolylines, Mtext, Hatches, bound in a block for easy moving, only native objects! I'd use a crayon before I would use OLE.

  • @Roy Klein Gebbinck said:
    @jaekma:
    What is your experience with the print quality of Excel OLE objects in BricsCAD?

    they print well it looks like an excel sheet on the print but very legible.

  • @Roy Klein Gebbinck said:
    The OLE object seems to be positioned relative to the top left corner of the CAD window. Why don't you check the InsertionPoint property of the OLE object?

    I've tried this. I can get the width and height but can not get the insert point.

  • @jaekma: It would help if you post your code.


  • Dim ent As AcadEntity, coord As Variant, fr As AcadEntity, pnt0(0 To 2) As Double, n As Integer, objEnt As AcadObject
    '/
    with thisdrawing
    .SendCommand ("pasteclip ")
    ZoomExtents
    '/GET HEIGHT & WIDTH OF XL
    For Each ent In ThisDrawing.ModelSpace
    Set objEnt = ent
    frWid = Round(ent.Width, 4)
    frHt = Round(ent.Height, 4)
    Next ent
    End With

    **my code copies the excel before switching to this code inside Brics

  • Roy Klein Gebbinck
    edited December 2017

    This works for me:
    Sub LastOleInsertionPoint() Dim ent As AcadEntity Dim insPt As Variant If ThisDrawing.ModelSpace.Count > 0 Then Set ent = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1) If ent.ObjectName = "AcDbOle2Frame" Then insPt = ent.InsertionPoint MsgBox "Insertion point: " & insPt(0) & ", " & insPt(1) & ", " & insPt(2) Else MsgBox "Last entity in model space is not an OLE object" End If Else MsgBox "No entities in model space" End If End Sub

  • Roy,
    thanks so much I swear i tried .insertionpoint and couldn't get it to work. but your code works flawlessly Thank you !!!

This discussion has been closed.