ksperopoulos Posted January 6, 2016 Posted January 6, 2016 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? Quote
BlackBox Posted January 6, 2016 Posted January 6, 2016 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") ) ) ) ) ) ) Quote
ksperopoulos Posted January 6, 2016 Author Posted January 6, 2016 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. Quote
Lee Mac Posted January 6, 2016 Posted January 6, 2016 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. Quote
BlackBox Posted January 6, 2016 Posted January 6, 2016 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 Quote
ksperopoulos Posted January 6, 2016 Author Posted January 6, 2016 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! Quote
Lee Mac Posted January 6, 2016 Posted January 6, 2016 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. Quote
broncos15 Posted January 7, 2016 Posted January 7, 2016 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! Quote
Lee Mac Posted January 7, 2016 Posted January 7, 2016 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! Quote
broncos15 Posted January 7, 2016 Posted January 7, 2016 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. Quote
Lee Mac Posted January 7, 2016 Posted January 7, 2016 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. Quote
broncos15 Posted January 7, 2016 Posted January 7, 2016 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! Quote
broncos15 Posted January 7, 2016 Posted January 7, 2016 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? Quote
ksperopoulos Posted January 7, 2016 Author Posted January 7, 2016 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? Quote
Lee Mac Posted January 7, 2016 Posted January 7, 2016 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. Quote
BlackBox Posted January 7, 2016 Posted January 7, 2016 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. Quote
Lee Mac Posted January 10, 2016 Posted January 10, 2016 ...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 Quote
broncos15 Posted January 11, 2016 Posted January 11, 2016 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. Quote
Lee Mac Posted January 11, 2016 Posted January 11, 2016 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. Quote
Recommended Posts
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.