Results 1 to 9 of 9

Thread: is there an equivalent of "entnext" in vla

  1. #1
    Active Member
    Join Date
    2005-12
    Posts
    72
    Login to Give a bone
    0

    Default is there an equivalent of "entnext" in vla

    Hi there,
    is there an equivalent of "entnext" in vla functions or do we have to switch back and forth between ename <-> vla-object to find the subsequent object in drawing database. thanks

  2. #2
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: is there an equivalent of "entnext" in vla

    Quote Originally Posted by blasto View Post
    Hi there,
    is there an equivalent of "entnext" in vla functions or do we have to switch back and forth between ename <-> vla-object to find the subsequent object in drawing database. thanks :)
    As I understand it, if the VL-obj have COUNT , as property ,there are subsequent object on it

    At least it is how I dig on BLOCKS from the BLOCKS collection .

  3. #3
    Active Member
    Join Date
    2005-12
    Posts
    72
    Login to Give a bone
    0

    Default Re: is there an equivalent of "entnext" in vla

    Well, thanks for the suggestion, devitg but I couldn't manage to utilize vla-get-count property the way you have stated.. there is a screenshot attached indicating the error.
    I think I'm missing something, I would be glad if you can give a simple usage example of that COUNT property.
    Attached Images Attached Images

  4. #4
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: is there an equivalent of "entnext" in vla

    Quote Originally Posted by blasto View Post
    Well, thanks for the suggestion, devitg but I couldn't manage to utilize vla-get-count property the way you have stated.. there is a screenshot attached indicating the error.
    I think I'm missing something, I would be glad if you can give a simple usage example of that COUNT property.
    The inspect window speak by it self , your object has no count property.
    Please uopload or send me offline a 2008 acad sample dwg

  5. #5
    Active Member
    Join Date
    2005-12
    Posts
    72
    Login to Give a bone
    0

    Default Re: is there an equivalent of "entnext" in vla

    ok, I've attached a sample dwg with two dynamic blocks inserted. (blocks have an attribute inside) I couldn't get count property of these blocks and to find the next object in database I'm using such a transformation:

    Code:
    (vlax-ename->vla-object (entnext (vlax-vla-object->ename vla_obj)))
    Attached Files Attached Files

  6. #6
    I could stop if I wanted to msretenovic's Avatar
    Join Date
    2002-02
    Location
    Galloway, Oh
    Posts
    305
    Login to Give a bone
    0

    Wink Re: is there an equivalent of "entnext" in vla

    If you want to get the attributes in a block, you will need to use vla-GetAttributes; you can use vla-Get-HasAttributes to determine if the block has attributes before trying to get them.

    Also, if you are trying to get the dynamic block properties, you can use vla-Get-IsDynamicBlock to see if it is a dynamic block and vla-GetDynamicBlockProperties to get the dynamic properties available.

    If, however, you are looking to get, manipulate, or add geometry to a block, you will need to do so with the block definition. In your screen shot, you are showing a block reference. You can get the block definition from the block collection in the drawing as shown here (using your KOT_OBJ variable):
    Code:
    ;;get the block collection from the current drawing
    (setq colBlocks (vla-Get-Blocks (vla-Get-ActiveDocument (vlax-Get-Acad-Object)))
          ;;get the block definition for the block reference
          objBDef   (vla-Item colBlocks (vla-Get-Name KOT_OBJ))
    )
    HTH,

  7. #7
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: is there an equivalent of "entnext" in vla

    Hi Michael , you speak for me .
    Thanks

  8. #8
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: is there an equivalent of "entnext" in vla

    And just to clarify for everyone here: the ActiveX objects have an Item method if it also has a Count Property. The count property is similar to the length / sslength functions, white Item can be seen as nth / ssname. Also the document (drawing) itself doesn't have items inside it. Rather it has several collections of items (of which the Blocks are one collection).

    There's no perfect equivalent to entnext using ActiveX. The Item method (or vla-Item) takes usually an integer (similar to nth), but in some cases a string as optional (e.g. the block's name). So first, you'll need to get the collection where your entity is situated (e.g. the ModelSpace block definition), then if you don't have its index number you'll need to step through the items in order to find it ... and then of course 1+ to get the next.

    But as the most common use for entnext is attributes, Micheal's method is how you "should" do it through ActiveX. Similar for complex entities like older 2dPolylines and such, they generally have an indexed vertexes property.

  9. #9
    Active Member
    Join Date
    2005-12
    Posts
    72
    Login to Give a bone
    0

    Default Re: is there an equivalent of "entnext" in vla

    thanks everyone! you enlightened the issue pretty well and showed me a new path of vlax usage.. but in this particular case I'd better stick with good old entnext for now

Similar Threads

  1. Need single-door equivalent of Revit's "Store Front Double Door"
    By Ralph.143107 in forum Revit Architecture - Families
    Replies: 3
    Last Post: 2016-05-23, 03:25 PM
  2. Replies: 0
    Last Post: 2012-06-06, 11:54 AM
  3. Equivalent of ETABS "end offsets" in Robot
    By strozy in forum Robot Structural Analysis
    Replies: 3
    Last Post: 2010-06-22, 02:53 PM
  4. ENTIDADES EN ALIGNMENT COMO "FIXED", "FLOTING" y "FREE"
    By cadia in forum AutoCAD Civil 3D - General
    Replies: 1
    Last Post: 2009-02-01, 04:21 AM
  5. Is there an "xopen" equivalent?
    By gordon.84736 in forum Revit Architecture - General
    Replies: 1
    Last Post: 2005-07-01, 01:07 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
  •