Results 1 to 3 of 3

Thread: Accessing object properties with an objectOD

  1. #1
    Member
    Join Date
    2017-04
    Posts
    10


    Default Accessing object properties with an objectID

    Beginner Question:
    I have a selectionset of objectIds, i guess its called an objectidcollection. How can i get the layer of each of these? I thought something like myObjectID.layer would work but it doesnt. I also tried creating an Object using:
    Object myNewObj = objID.(GetObject (OpenMode.ForRead) as Object

    and then using:
    myNewObj.layer

    but that doesnt work either. Im sure this is very simple but i cant figure it out or find example code like this anywhere.

    Thanks for any help.

    James
    Last edited by jrauden748232; 2017-05-23 at 06:48 PM. Reason: Mistake

  2. #2
    Member
    Join Date
    2017-04
    Posts
    10


    Default Re: Accessing object properties with an objectOD

    Ok, figured it out. I have to cast the object to an Entity then use myEnt.layer.
    Am i supposed to answer my own questions if i figure them out? Or delete the thread? Or just let it be?

    Thankx

  3. #3
    Programming Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,125


    Default Re: Accessing object properties with an objectOD

    Quote Originally Posted by jrauden748232 View Post
    Ok, figured it out. I have to cast the object to an Entity then use myEnt.layer.
    Am i supposed to answer my own questions if i figure them out?
    Glad you got it sorted; we all need help sometimes, but figuring things out for ourselves is the best way to learn.

    Answering your own questions helps someone else down the line save time, which is always appreciated.


    Cheers
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Autodesk Exchange Apps

Similar Threads

  1. Accessing object inside block reference
    By a.ghensi689507 in forum VBA/COM Interop
    Replies: 0
    Last Post: 2015-03-23, 10:53 AM
  2. Copy Object Properties Before Creating a Similar Object
    By acadwishlist in forum AutoCAD Wish List
    Replies: 8
    Last Post: 2012-07-01, 03:03 AM
  3. New object properties not matching layer properties
    By domniki in forum AutoCAD General
    Replies: 5
    Last Post: 2010-03-23, 09:48 AM
  4. Accessing embedded object data
    By anderson.scottglen in forum AutoLISP
    Replies: 3
    Last Post: 2009-04-09, 06:57 PM
  5. Object properties palette not showing selected Objects properties
    By timothyjturner in forum AutoCAD General
    Replies: 22
    Last Post: 2007-08-10, 05:21 PM

Posting Permissions

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