+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Full Member
    Discipline
    Electrical
    btraemoore's Discipline Details
    Occupation
    Electrical Designer
    Discipline
    Electrical
    Using
    AutoCAD 2012
    Join Date
    Apr 2012
    Location
    Houston
    Posts
    60

    Default Accessing a layers linetype name?

    Registered forum members do not see this ad.

    From what i am reading, it takes some work to access a layers linetype name (LineTypeTableRecord.name). Is there another way around this? Is there a way to access the linetype name from within the layer in question?

  2. #2
    Luminous Being BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    2 x 240GB Samsung EVO SSD (RAID 0)
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Discipline
    Civil
    BlackBox's Discipline Details
    Occupation
    Senior Civil Designer
    Discipline
    Civil
    Details
    Public/Private Land Development, Transportation, and Utilities.
    Using
    Civil 3D 2016
    Join Date
    Nov 2009
    Posts
    5,282

    Default

    No work at all, really... You might want to check out Viru's ADNDevBlog article Identifying the entities line type, which is one of the top few results in a quick Google search.
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Exchange Apps ~ Autoloader ~ AutoCAD Security

  3. #3
    Full Member
    Discipline
    Electrical
    btraemoore's Discipline Details
    Occupation
    Electrical Designer
    Discipline
    Electrical
    Using
    AutoCAD 2012
    Join Date
    Apr 2012
    Location
    Houston
    Posts
    60

    Default

    i figured it out, i was just not thinking the right way..

    Code:
    LinetypeTableRecord Ltype = (LinetypeTableRecord)curTrans.GetObject(
    						curLayer.LinetypeObjectId,OpenMode.ForRead
    				        );
    newRow["LINETYPE"] = Ltype.Name;

  4. #4
    Luminous Being BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    2 x 240GB Samsung EVO SSD (RAID 0)
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Discipline
    Civil
    BlackBox's Discipline Details
    Occupation
    Senior Civil Designer
    Discipline
    Civil
    Details
    Public/Private Land Development, Transportation, and Utilities.
    Using
    Civil 3D 2016
    Join Date
    Nov 2009
    Posts
    5,282

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by btraemoore View Post
    i figured it out, i was just not thinking the right way..

    Code:
    LinetypeTableRecord Ltype = (LinetypeTableRecord)curTrans.GetObject(
    						curLayer.LinetypeObjectId,OpenMode.ForRead
    				        );
    newRow["LINETYPE"] = Ltype.Name;
    I should hope so... That's exactly what Viru did in his code sample in the above referenced article (get the Name Property of the LinetypeTableRecord Object).

    Glad you got it sorted.
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Exchange Apps ~ Autoloader ~ AutoCAD Security

Similar Threads

  1. Replies: 0
    Last Post: 9th Nov 2011, 08:30 am
  2. Replies: 0
    Last Post: 19th Aug 2011, 06:20 pm
  3. Accessing all of the layers in a document
    By harrison-matt in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 27th Oct 2010, 06:27 pm
  4. linetype and the layers
    By astrosfan in forum AutoCAD Beginners' Area
    Replies: 2
    Last Post: 22nd Sep 2008, 03:38 pm
  5. changing default linetype layers
    By mikemilburn in forum AutoCAD Beginners' Area
    Replies: 18
    Last Post: 1st Nov 2005, 12:17 pm

Tags for this Thread

Bookmarks

Posting Permissions

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