Jump to content

how to look at dxf group code of a layer


Jef!

Recommended Posts

Hi all

 

In a lisp I look if a layer exists with (tblsearch "LAYER" name) than if it doesn't i create it with entmake using dxf group code

(entmake
           (list
              '(0 . "LAYER")
              '(100 . "AcDbSymbolTableRecord")
              '(100 . "AcDbLayerTableRecord")
              '(70 . 0)
               (cons 2 "DIM")
               (cons 6 "Continuous")
               (cons 370 9); lineweight -3 is default
           )
       )

It work, but while all our layers have a "black" plot style this create a layer with "normal" plot style. I have many references, guides and indexes of dxf group code, but none have any info regarding what code is the plot style. I thought that it would be easy to "look at a layers dxf group code" from a drawing that is setuped as required and compare it with the layer I just made, to see what code is missing, then add the corresponding code line in my entmake... but don't have any clue how to achieve that.

How can I see the dxf code of an existing layer? (It doesn't need to be a lisp, it could be something to type directly in the command line)

Thanks,

Jef!

Link to comment
Share on other sites

Jef!,

 

Not too sure on this one, but I believe that you will need to go to activex to change the plotstyle.

 

Have a look at this thread: http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Can-I-change-plot-style-with-lisp/td-p/895834

 

I dug a little more and there might be a solution with vanilla lisp.

 

See this post by Roy_043 at the swamp https://www.theswamp.org/index.php?topic=45131.msg503393#msg503393

 

ymg

Link to comment
Share on other sites

Thanks for the fast reply and the reference.

 

 

Wow, there are way more stuff in the tblobjname of a layer than i expected. Even tho there are 286 pages in Autodesk's dxf reference, there is not much on the subject beside "390 Hard-pointer ID/handle of PlotStyleName object". No list id or handle list.

From what I could see within many of my drawings in which dim has the correct plotstyle the 390. dxf value vary..?

(390 . )

(390 . )

(390 . )

(390 . )

I tried to add a 390 dxf code but failed in each try.

 

 

ymg, this thread will be very usefull, as an addon we use generate one layer with "normal" as plot style. I guess that I could generate the layer then use that lisp to change the plotstyle to black. I would like to create it with the correct plotstyle right away, but I guess this will get the job done. will give it a try. thanks

Link to comment
Share on other sites

Jef!,

 

From what I gathered you have to manipulate dxfcode 350 to be able to change the 390.

 

As you create your layer you could do this right after, but it might be a little more complicated than that.

Better look at the entire thread there.

 

ymg

Link to comment
Share on other sites

ymg3,

the 2nd link you shared is a very interesting piece of information. Funny fact tho: I've just checked my "dim" layer from a Template drawing, and there are no dxfcode 350.

As you create your layer you could do this right after, but it might be a little more complicated than that.

I've made a variant of one of the lsp on he first link you gave. I've localized variables to begin with, then changed in the progn to check as follow:

if (not (or (=black) (=exeption) )) it make it change to black. Very simple, fast, and it also grab the layer with "normal" as plot style that is created by an addon we sometime use.

Like they say, we just killed 2 birds with 1 stone within few minutes. (without any complications of any kind!)

Thanks a lot guys!

Link to comment
Share on other sites

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...