Jump to content

Recommended Posts

Posted

I am trying to create a new layer using ENTMAKE but I don't know what I am doing wrong. According to the help manual (which is creating a circle, not a layer), it looks like my code is correct. Any help pointing me in the right direction? (BTW - "layelev" and "laycolr" are variables I have stored earlier in my program.)

 

              (entmake ((0 . "LAYER")
                             (100 . "AcDbLayerTableRecord")
                             (2 . layelev)
                             (70 . 0)
                             (62 . laycolr)
                             (6 . "Continuous")
                             (290 . 1)
                             (370 . "0.25")
                            )
             )

Posted
(entmake '((0 . "LAYER")
          (100 . "AcDbSymbolTableRecord")
          (100 . "AcDbLayerTableRecord")
          (2 . "[color="red"]YourLayerName[/color]")
          (62 . 1)
          (6 . "Continuous")
        )
)

Posted

Do you mean I can't use variables that are storing the layer name in this situation? And why the two 100 DXF codes?

Posted
Do you mean I can't use variables that are storing the layer name in this situation? And why the two 100 DXF codes?

 

Yes you can use variables. Use list and cons instead of quote.

 

(entmake
     ([color="red"]list[/color]
       '(0 . "LAYER")
       '(100 . "AcDbSymbolTableRecord")
       '(100 . "AcDbLayerTableRecord")
       ([color="red"]cons[/color] 2 [color="blue"]layelev[/color])
       '(70 . 0)
       ([color="red"]cons[/color] 62 [color="blue"]laycolr[/color])
       '(6  . "Continuous")
       '(290 . 1)
       '(370 . 25)
     )
)

Posted

Thank you for showing me about CONS. I see you have used an apostrophe in your code above. I have seen it in other people's code as well. What does the apostrophe mean?

Posted
I see you have used an apostrophe in your code above. I have seen it in other people's code as well. What does the apostrophe mean?

 

As it happens, Lee has kindly saved us from attempting to explain this, as he's just added another nice article:

 

The Apostrophe and the Quote Function

Posted

I seriously doubt I will ever be able to remember all that. :shock: I need to add this link to my favorites so I can reference it later. What would we all do without Lee?

 

Now that I have a vague understanding of apostrophe's and CONS, why is there two 100 DXF codes that make this work? When I look at the DXF codes for layers in the help file, it only shows one.

Posted

An alternative if your only making a single layer

 

(command "_layer" "n" layelev "C" laycolr "LT" "Continous") 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...