Lee Mac Posted January 4, 2011 Share Posted January 4, 2011 I think it would be better to retain ALL properties of the original object - also, what about MText AttDefs? Here's one from my library written a while back Lee AttDef2Text.lsp Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 4, 2011 Share Posted January 4, 2011 but re-writing the code using VLisp is easier i guess.. I don't think Visual LISP is the way to go in this case. Visual LISP properties must be accessed individually, whereas DXF data has all the information you need, and in a list - which LISP is built to deal with. Lee Quote Link to comment Share on other sites More sharing options...
pBe Posted January 4, 2011 Share Posted January 4, 2011 I think it would be better to retain ALL properties of the original object - also, what about MText AttDefs? Here's one from my library written a while back Lee wayyyy better.... I would have written the same way if given the time.... Good one Lee, as always Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 4, 2011 Share Posted January 4, 2011 wayyyy better.... I would have written the same way if given the time.... Good one Lee, as always Yours wasn't bad my friend - I think you had the right approach, just instead of pulling data from the original item, I would have removed what I didn't need (as my code demonstrates) - that way, there's less chance of missing something. Also, a little tip: (cons 40 (cdr (assoc 40 fao_pro))) Could be replaced with: (assoc 40 fao_pro) :wink: Quote Link to comment Share on other sites More sharing options...
Michaels Posted January 4, 2011 Author Share Posted January 4, 2011 u-uh.... No my friend DXF 62 is not always present as well as DXF for linetype (6) We can re-write the whole thing if you like what you can do is test for existence of DXF 62 and 6, if found then add / if not dont add but re-writing the code using VLisp is easier i guess.. That's right . I mentioned that because my Att were not on its color By Layer . I am sorry for that mistake . Quote Link to comment Share on other sites More sharing options...
pBe Posted January 4, 2011 Share Posted January 4, 2011 Also, a little tip: (cons 40 (cdr (assoc 40 fao_pro))) Could be replaced with: (assoc 40 fao_pro) :wink: Lee, you're right since i wont be assigning to a variable anyway, Good point Lee Thanks my friend Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 4, 2011 Share Posted January 4, 2011 since i wont be assigning to a variable anyway Not sure what you mean, but I meant because you have: (assoc 40 <elist>) ==> [color=red](40 . <height>)[/color] -------------------------------------------------- (cdr (assoc 40 <elist>)) ==> <height> -------------------------------------------------- (cons 40 (cdr (assoc 40 <elist>))) ==> [color=red](40 . <height>)[/color] Quote Link to comment Share on other sites More sharing options...
pBe Posted January 4, 2011 Share Posted January 4, 2011 Definitely. And sometimes color of it being different , so we could add as well . (cons 62 (cdr (assoc 62 fao_pro))) Appreciated You know what, we never have that porblem, you see the company i work for has a strict standard compliance.. do everything BYLAYER. I sugest you do the same just a suggestion Michaels Quote Link to comment Share on other sites More sharing options...
pBe Posted January 4, 2011 Share Posted January 4, 2011 Not sure what you mean, but I meant because you have: (assoc 40 <elist>) ==> [color=red](40 . <height>)[/color] -------------------------------------------------- (cdr (assoc 40 <elist>)) ==> <height> -------------------------------------------------- (cons 40 (cdr (assoc 40 <elist>))) ==> [color=red](40 . <height>)[/color] Yup... I understand Lee, instead of breaking it apart and use cons to constuct it again, might as well use the whole thing. my reason for saying that is if i will be using the info for something else other than entmake function, i would've assign it to a variable. your suggestion is always welcome (that's how i learn) Thanks Quote Link to comment Share on other sites More sharing options...
irneb Posted January 4, 2011 Share Posted January 4, 2011 (assoc 40 fao_pro) Not too sure if it's a good thing ... I tend to get itchy whenever I work with any form of text using DXF code lists. And as soon as there's anything to do with the text height that itch just becomes irritating. This is mainly due to annotative text becoming screwed up when you modify (or just reuse) the text height when using entmod / entmake. But for this case it's probably not an issue because extremely seldom would the Attrib entity have been annotative itself. The block might have been, but I'd say the Attr would be very strange indeed if so. But still that itch is bothering me ... what if the current and / or attrib's text style is set to be annotative? Would an entmake still screw it up? Or would the new text entity simply have anno turned off? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 4, 2011 Share Posted January 4, 2011 I don't do dealings in Annotative stuff - I'll happily leave that to you Quote Link to comment Share on other sites More sharing options...
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.