Kean Walmsley

July 2009

Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Twitter Updates

    follow me on Twitter



    « AutoCAD 2008 - new .NET samples | Main | Getting access to an entity from its handle in AutoCAD .NET »

    February 16, 2007

    AutoCAD 2008 – other new APIs

    In the previous two posts we looked at the new ObjectARX samples and the new .NET samples available for AutoCAD 2008.

    AutoCAD 2008 also exposes a number of new APIs (and enhancements to old ones) for which we don’t have new SDK samples. Take a look of the ‘Migration Guide for Applications’ for a comprehensive list of new classes and new methods and properties within classes. Check the AutoCAD Managed Class Reference for Managed equivalents.

    And once again - let me know if there are any of specific interest to you, and we'll see what we can do. :-)

    Layers per viewport

    Complementing the new annotation scaling feature, you can now override layer parameters such as color, plot style, lineweight and linetype on a per viewport basis.

    You can also dim layers per viewport, to make the important information stand out.

    Multi-leaders

    The new Mleader (AcDbMLeader) entity allows you to insert leaders with multiple arrows.

    Wipeout

    Formerly part of Express Tools, the Wipeout (AcDbWipeut) entity has for a number of releases been part of the standard AutoCAD feature set. In this release we finally publish a fully supported API for this feature.

    InfoCenter

    The InfoCenter is an integrated search tool allowing the user to search a range of online content, including product helpfiles, the Autodesk Knowledge Base, newsgroup postings, and other autodesk.com information - as well as blogs such as this one :-). InfoCenter feature has a managed API that allows you to integrate your own content with this tool.

    Dimension enhancements

    We’ve introduced a lot of dimension enhancements, all of which are reflected in th API. These include Dimension Break, Tolerance Alignment, Inspection Dimensions, and Jogged Linear Dimensions… to name but a few.

    Multiline attributes

    Attributes can now span multiple lines… enough said.

    DWF and DGN Underlays

    An underlay is like a raster image, but you can snap to the geometry. AutoCAD 2008 underlays allow you to create geometry based on DWG and DGN files. DWF underlays are represented by the DwfDefinition and DwfReference classes. DGN underlays by DgnDefinition and DgnReference.

    Tool palette enhancements

    The tool palette API has been extended to include support for user-defined images and drag and drop enhancements.

    TrackBack

    TrackBack URL for this entry:
    http://www.typepad.com/services/trackback/6a00d83452464869e200d834e911c553ef

    Listed below are links to weblogs that reference AutoCAD 2008 – other new APIs:

    Comments

    When do I receive autocad2008?
    Can I already download it before the dealer has send the dvd?

    The specific release date has not yet been announced, as far as I'm aware. I'd suggest checking in regularly with this site:

    http://www.autodesk.com/preview2008

    WIPEOUT IS APPARENTLY INCOMPATIBLE WITH AUTOCAD 2008 (AT LEAST THAT IS WHAT AUTOCAD RESPONDS BACK WHEN TRYING TO LOAD WIPEOUT.ARX). IS THERE SOME OTHER COMMAND THAT PERFORMS LIKE WIPEOUT?

    ANY HELP WOULD BE GREATLY APPRECIATED.

    The WIPEOUT command runs fine on my installation of AutoCAD 2008. It causes acwipeout.arx and acwipeoutobj17.dbx to be demand-loaded.

    Kean

    Hi Kean, Thanks for the effort you put into this blog, it's a great resource. I cannot resolve creating a Wipeout in VB.Net for 2008. The follwing code creates a Wipout, but either crashes AutoCAD, or when I move the object get Fatal Error, or the Wipeout doesn't hide objects:
    Dim bt As BlockTable = tm.GetObject(db.BlockTableId, OpenMode.ForRead, False)
    Dim btr As BlockTableRecord = tm.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite, False)
    Call lentWipeout.SetFrom(lcolWipeoutPoints, lvecNormal)
    loidWipeoutID = btr.AppendEntity(lentWipeout)
    tm.AddNewlyCreatedDBObject(lentWipeout, True)
    ta.Commit()
    I have googled for days, so I hope you don't mind.... Dale

    Hi Dale,

    How are you creating lentWipeout and populating the points lcolWipeoutPoints?

    Regards,

    Kean

    OK - I see you've just had a response via ADN, Dale: I hope this solves your problem.

    Kean

    Hi Kean, I have determined my error was in providing only 4 points to the Point2DCollection rather than returning to the first point. No other change was needed. I hope the following code helps someone else. Regards, Dale

    Public Function CreateWipeout() As ObjectId
    Dim loidWipeoutID As ObjectId
    Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
    Dim tm As DBTransMan = db.TransactionManager
    Dim lentWipeout As New Wipeout
    Dim lvecNormal As New Vector3d(0.0, 0.0, 1.0)
    Dim lpntPoint2D As Point2d = Nothing
    Dim lcolWipeoutPoints As New Point2dCollection() 'this is 2DPoint to suit Wipeout, add Z to suit Line

    lentWipeout.Layer = "0"

    'start a transaction
    Dim ta As Transaction = tm.StartTransaction()
    Try
    Dim bt As BlockTable = tm.GetObject(db.BlockTableId, OpenMode.ForRead, False)
    Dim btr As BlockTableRecord = tm.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite, False)

    'fill 2D Point collection with 4 points
    lpntPoint2D = New Point2d(0, 0)
    lcolWipeoutPoints.Add(lpntPoint2D)
    lpntPoint2D = New Point2d(500, 0)
    lcolWipeoutPoints.Add(lpntPoint2D)
    lpntPoint2D = New Point2d(500, 500)
    lcolWipeoutPoints.Add(lpntPoint2D)
    lpntPoint2D = New Point2d(0, 500)
    lcolWipeoutPoints.Add(lpntPoint2D)
    lpntPoint2D = New Point2d(0, 0)
    lcolWipeoutPoints.Add(lpntPoint2D)
    Call lentWipeout.SetFrom(lcolWipeoutPoints, lvecNormal)

    loidWipeoutID = btr.AppendEntity(lentWipeout)
    tm.AddNewlyCreatedDBObject(lentWipeout, True)
    ta.Commit()
    Finally
    ta.Dispose()
    CreateWipeout = loidWipeoutID
    End Try
    End Function

    Hi Dale,

    I discovered the same thing, late yesterday. I'll post my C# code later today.

    Thanks for letting us know,

    Kean

    Multiline attributes: Not "enough said"

    If you edit a a block with multiline attributes with multiple text, it strips line feed from text. This made text one long line although Mtext like width is maintain.

    Another "feature"; if the attribute in a block refereance is moved using it's grips, vectors "disapear" till a regen is issued.

    Installing SP2 does not make diffeance.

    Your issues seem more related to product functionality than to code I've posted on this blog.

    Please submit your product issues via your reseller or via the appropriate discussion group.

    Kean

    Verify your Comment

    Previewing your Comment

    This is only a preview. Your comment has not yet been posted.

    Working...
    Your comment could not be posted. Error type:
    Your comment has been posted. Post another comment

    The letters and numbers you entered did not match the image. Please try again.

    As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

    Having trouble reading this image? View an alternate.

    Working...

    Post a comment

    Feed & Share

    Search