Jump to content

Recommended Posts

Posted

Is there not a layer description dxf code? I can't find anything in the documentation. It looks like the only way to create a layer description is through 'vla-put-description'. Am I correct?

  • Replies 45
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    19

  • ksperopoulos

    17

  • broncos15

    7

  • BlackBox

    3

Posted

Using Visual LISP is far simpler to develop, and maintain (not to mention human readable), but to answer the question of DXF Code, a Layer Table Record's Description is stored in extended entity data (group code 1000):

 

(defun _GetLayerDescription (layname)
 (cdr (last (cadr (assoc -3
                         (entget (tblobjname "layer" layname)
                                 '("AcAecLayerStandard")
                         )
                  )
            )
      )
 )
)

Posted

Thank you for your response. I am curious about how you are using 'last'. Have you ever encountered a scenario when the last 1000 group code in the list was not the layer description? If the description is in the same spot every time, I would feel comfortable using it this way, but if it has a chance of moving, then I may need to find another method. Maybe it's time I start to understand visual lisp a little more if that is a more stable solution.

Posted
It looks like the only way to create a layer description is through 'vla-put-description'. Am I correct?

 

See lines 324-336 of my Layer Director program for an existing example of how to set a layer description using Vanilla AutoLISP.

Posted

Thank you for your response. I am curious about how you are using 'last'. Have you ever encountered a scenario when the last 1000 group code in the list was not the layer description?

 

It is extended entity data, and I should think that there is the potentiality for it to not be in the same place each time - that code is just a quick example to demonstrate 'where'.

 

 

If the description is in the same spot every time, I would feel comfortable using it this way, but if it has a chance of moving, then I may need to find another method. Maybe it's time I start to understand visual lisp a little more if that is a more stable solution.

 

As I mention in my earlier post; I'd absolutely suggest you use the ActiveX Property in lieu of DXF, as you'd gain the ability to work with both the active document, other documents open in the document collection, as well as via ObjectDBX (batch processing drawings not in the document collection that are available for write).

 

The ActiveX is simpler to read, shorter code, and more capable; not seeing any downside.

 

 

Cheers

Posted
See lines 324-336 of my Layer Director program for an existing example of how to set a layer description using Vanilla AutoLISP.

 

Lee - even with your code, it still seems like there is nothing to prevent another 1000 group code from being inserted in front or behind the one containing the layer description.....is there?

 

The ActiveX is simpler to read, shorter code, and more capable; not seeing any downside.

 

BlackBox - sounds like it might be time to make the switch! :x

Posted
Lee - even with your code, it still seems like there is nothing to prevent another 1000 group code from being inserted in front or behind the one containing the layer description.....is there?

 

Of course not - you could similarly insert additional invalid DXF groups within the DXF data of any entity, but you will find the modification to be unsuccessful unless the data is in the expected format.

Posted
See lines 324-336 of my Layer Director program for an existing example of how to set a layer description using Vanilla AutoLISP.
Lee, I know that this doesn't have to do with your post, but I just have to complement you on this reactor, it is awesome!
Posted
Lee, I know that this doesn't have to do with your post, but I just have to complement you on this reactor, it is awesome!

 

Thank you! :)

Posted
Thank you! :)
No thank you, your LISP routines have saved me a ton of time. I am just curious, and I know that the answer is probably no, but is there an easy way to add in LISP routines to the command calls that would call the reactor? I am curious because my office has a few LISP routines for mleaders, dimensions, etc. that we use for when the drawing is twisted (ie angbase and snapang set to another value) or not at world coordinates and it would be nice to have them added in with the normal mtext and dimension commands.
Posted
No thank you, your LISP routines have saved me a ton of time.

 

That's great - I'm glad to hear it.

 

I am just curious, and I know that the answer is probably no, but is there an easy way to add in LISP routines to the command calls that would call the reactor?

 

Yes, this would be possible - I'll look to incorporate this into the next release.

Posted
Yes, this would be possible - I'll look to incorporate this into the next release.
Awesome, I look forward to your next release. Thanks again!
Posted

Lee, I apologize for all the posts about your reactor, but I had one more question. Is there an easy way to include plot style in the layer:director portion as well?

Posted
Of course not - you could similarly insert additional invalid DXF groups within the DXF data of any entity, but you will find the modification to be unsuccessful unless the data is in the expected format.

 

So if I understand you correctly, it would be so unlikely that another 1000 group code would get inserted into the list that I wouldn't have to worry about it at all?

Posted
So if I understand you correctly, it would be so unlikely that another 1000 group code would get inserted into the list that I wouldn't have to worry about it at all?

 

AutoCAD should always keep to the same xdata structure, and so unless one of your own custom applications is modifying that area of xdata incorrectly, modifying the last DXF 1000 group value should be reliable.

Posted
AutoCAD should always keep to the same xdata structure, and so unless one of your own custom applications is modifying that area of xdata incorrectly, modifying the last DXF 1000 group value should be reliable.

 

Well stated; as always.

Posted
...is there an easy way to add in LISP routines to the command calls that would call the reactor?

Is there an easy way to include plot style in the layer:director portion as well?

 

I have now updated my Layer Director program to incorporate these two suggestions - thank you for the feedback!

 

Lee

Posted
I have now updated my Layer Director program to incorporate these two suggestions - thank you for the feedback!

 

Lee

Your updated program is awesome and thank you so much for the updates! Your use of the append function for the plot style mode is much better than the solution that I was thinking of, which wouldn't have allowed the data to be entered into the same location as all the other layer data. I will be studying this code because it is the most advanced reactor that I have seen so far and your coding is so detailed like usual.
Posted
Your updated program is awesome and thank you so much for the updates! Your use of the append function for the plot style mode is much better than the solution that I was thinking of, which wouldn't have allowed the data to be entered into the same location as all the other layer data.

 

Thank you! :)

 

I will be studying this code because it is the most advanced reactor that I have seen so far and your coding is so detailed like usual.

 

Thank you for your compliments, though the use of a reactor in this program is actually relatively simple - if you were looking for more advanced examples to study, you may want to consider my Associative Textbox program or Automatically Label Attributes program.

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