Tharwat Posted January 31, 2016 Share Posted January 31, 2016 Thank you Lee , I am aware of that emulation of Vanilla in VLisp though I still prefer using dictsearch function than Vlisp in this regard. Tharwat was warning me about based on examples you have given me before. Where did I warned you about that? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 31, 2016 Share Posted January 31, 2016 Ok. So in this case, would the vl-catch-all-apply function be applied like this? (vl-catch-all-apply 'vla-item (vla-item (vla-get-dictionaries doc) "ACAD_MLEADERSTYLE") ([i]mleader style name[/i])) Not quite - as noted above, vl-catch-all-apply requires a list of arguments. It would also be prudent to test for the existence of the acad_mleaderstyle dictionary to account for versions in which MLeaders are not available, i.e.: (if (not (or (vl-catch-all-error-p (setq dic (vl-catch-all-apply 'vla-item (list (vla-get-dictionaries (vla-get-activedocument (vlax-get-acad-object) ) ) "acad_mleaderstyle" ) ) ) ) (vl-catch-all-error-p (setq sty (vl-catch-all-apply 'vla-item (list dic "yourmleaderstylehere") ) ) ) ) ) sty ) Alternatively, using my LM:getitem function linked above: (if (setq dic (LM:getitem (vla-get-dictionaries (vla-get-activedocument (vlax-get-acad-object))) "acad_mleaderstyle")) (LM:getitem dic "yourmleaderstylehere") ) Quote Link to comment Share on other sites More sharing options...
ksperopoulos Posted January 31, 2016 Author Share Posted January 31, 2016 But did you try to search for your MLStyle name while it is not existed into your drawing your codes as follows? ...just that I should have something in my code to protect me from unwanted results due to a mleader style that does not exist in my drawing file. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 31, 2016 Share Posted January 31, 2016 ...just that I should have something in my code to protect me from unwanted results due to a mleader style that does not exist in my drawing file. I did not post any complete codes as long as you have mentioned in your first post that you need a direction and don't want anyone to write it for you also as long as you'd like to investigate it by yourself that would be encouraging thing. is there any logic reason which made you to go with VLisp versus DXF ? Quote Link to comment Share on other sites More sharing options...
ksperopoulos Posted January 31, 2016 Author Share Posted January 31, 2016 I did not post any complete codes as long as you have mentioned in your first post that you need a direction and don't want anyone to write it for you also as long as you'd like to investigate it by yourself that would be encouraging thing. I know you didn't post code. I wasn't expecting you to. I do want to learn. I was merely stating you were helping me and that I could run into errors if I didn't check for the mleader style first. is there any logic reason which made you to go with Vlisp and with DXF ? There was no logical reason. I was just curious about another method to see which one I would like better. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted January 31, 2016 Share Posted January 31, 2016 There was no logical reason. I was just curious about another method to see which one I would like better. If you'd like to know my opinion about the which way to go with coding with which codes Lisp or Vlisp , I would go first with DXF codes unless it needs too much line of codes otherwise I would jump to Vlisp. DXF or Vanilla AutoLISP is faster, easier than Vlisp, covers almost all you to do with daily works in general and what's more it's cute. Quote Link to comment Share on other sites More sharing options...
ksperopoulos Posted January 31, 2016 Author Share Posted January 31, 2016 It would also be prudent to test for the existence of the acad_mleaderstyle dictionary to account for versions in which MLeaders are not available Thank you for the suggestion. I don't know if I would necessarily need the first vl-catch-all-apply due to our offices operating on release 2014 and later, but it might be worth incorporating it just in case. In regards to your code, do I understand it correctly? It seems you are passing arguments to your subfunction? Also, can you make anything into a list by using the list function? (Sorry for my ignorance. I still have a little trouble figuring out if a function returns/uses arguments, elements, objects, lists, etc.) Quote Link to comment Share on other sites More sharing options...
ksperopoulos Posted January 31, 2016 Author Share Posted January 31, 2016 If you'd like to know my opinion about the which way to go with coding with which codes Lisp or Vlisp , I would go first with DXF codes unless it needs too much line of codes otherwise I would jump to Vlisp. DXF or Vanilla AutoLISP is faster, easier than Vlisp, covers almost all you to do with daily works in general and what's more it's cute. I would tend to agree. But recently, I have been looking at a lot of coding from others that use VL. The terminology seems easier to understand and refer back to without using a help file (especially for a novice like me). Right now trying to figure it out is difficult because the only thing I have experience with is vanilla LISP. I'm sure that won't always be the case though once I get used to it. 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.