Results 1 to 4 of 4

Thread: Problem with LabelCurves and MVBlockRefs

  1. #1
    Member
    Join Date
    2008-09
    Posts
    6

    Default Problem with LabelCurves and MVBlockRefs

    Hello everybody!

    First of all I’m using MEP 2008.

    Second: I have used the search button, but no luck!


    I have a drawing, which has devices and wires in it. For these objects there are MVBlockRefs and LabelCurves showing different properties. Every device and wire has a custom property set. I am trying to create a macro, that hides all objects, that have a property in this property set equal to given. I got it working for the devices and wires, but the labels associated with them are the problem. As the labels doesn't have the property set, I need to know, how to get the referenced object.

    My code scans the ThisDrawing.ModelSpace to acquire objects and labels:

    For Each Item In ThisDrawing.ModelSpace
    If ((Item.ObjectName = "AecbDbDevice") Or (Item.ObjectName = "AecbDbConduit") Or (Item.ObjectName = "AecbDbConduitFitting") Or (Item.ObjectName = "AecbDbWire") Or (Item.ObjectName = "AecDbMvBlockRef") Or (Item.ObjectName = "AecbDbLabelCurve")) Then

    ...

    So I get the objects for the labels, but not the oject the label is referring to (device or wire). Thought property OwnerID will give out this information, but it refers to the Modelspace object.

    Does anyone know, how to get the object, label is referring to?

    Regards,
    Rait Raak

  2. #2
    Administrator RobertB's Avatar
    Join Date
    2001-08
    Location
    Dallas TX USA
    Posts
    5,825

    Default Re: Problem with LabelCurves and MVBlockRefs

    Not that this post is really going to help you, but: if you are doing MEP customization, VBA is not the language to use. .NET is the API that Autodesk is improving. VBA is a dead horse for API development.
    R. Robert Bell
    Design Technology Manager
    S P A R L I N G
    Opinions expressed are mine alone and do not reflect the views of Sparling.

  3. #3
    I could stop if I wanted to
    Join Date
    2002-02
    Location
    Kansas
    Posts
    482

    Default Re: Problem with LabelCurves and MVBlockRefs

    use the GetAnchor Method on the label object this will return an AecAnchorTagToEnt object if the label is attach as and schedule tag. Use the Reference Property of the AecAnchorTagToEnt object to get the entity the labe is tag to.
    Note:
    update to 2011
    I am using ADT 2007 08/06/2008

    PS. If you use any Code I post or Down Load Attachment I would like to know if it was helpful. So please post reply to this thread, on how you use the code or down load. Thank You

  4. #4
    Member
    Join Date
    2008-09
    Posts
    6

    Default Re: Problem with LabelCurves and MVBlockRefs

    Hello!

    RobertB,
    thanks for the pointer. Started reading a book about ARX with visual studio. At first glance objects and methods are the same as in VBA, so I do not see something much better. I will continue learning it this week. Of course writing in C++ is heavenly compared to basic

    jwanstaett,
    thank you! The method works, but only for MVBlockRefs. For LabelCurves it gives out error message saying "Method 'GetAnchor' of object 'IAecbLabelCurve' failed"

    Regards,
    Aq

Similar Threads

  1. interface problem after problem after problem
    By whatisrice in forum ACA General
    Replies: 1
    Last Post: 2009-08-12, 05:06 PM
  2. Zoom problem + dimension & leader problem
    By Mamma Jamma in forum AutoCAD General
    Replies: 2
    Last Post: 2009-06-16, 07:21 PM
  3. control open problem/file open problem in Autocad2006
    By sopori in forum AutoCAD 3D (2006 or below)
    Replies: 1
    Last Post: 2007-07-06, 12:13 AM
  4. Problem and desperation : Level height problem !!
    By Richard McCarthy in forum Revit Architecture - General
    Replies: 7
    Last Post: 2004-09-10, 03:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •