woodman78 Posted February 15, 2010 Posted February 15, 2010 I have setup a list to create my dimensions styles using the dim variables. How do I know what variables are in use for mleader style I have in a drawing? I want to be able to set "left attachment" and "right attachment". Thanks Quote
Lee Mac Posted February 15, 2010 Posted February 15, 2010 The settings are defined in the specific MLeaderStyle entry of the ACAD_MLeaderStyle Dictionary. You can get at the settings in two ways: (defun MLeaderStyleSettings (styl / mDict sObj) (vl-load-com) (if (not (vl-catch-all-error-p (setq mDict (vl-catch-all-apply (function vla-item) (list (vla-get-Dictionaries (vla-get-ActiveDocument (vlax-get-acad-object))) "ACAD_MLEADERSTYLE"))))) (if (not (vl-catch-all-error-p (setq sObj (vl-catch-all-apply (function vla-getObject) (list mDict styl))))) (vlax-dump-object sObj t)))) (defun MLeaderStyleSettings2 (styl / mDict) (if (setq mDict (dictsearch (namedobjdict) "ACAD_MLEADERSTYLE")) (dictsearch (cdr (assoc -1 mDict)) styl))) Example: (MLeaderStyleSettings "Standard") (MLeaderStyleSettings2 "Standard") Quote
woodman78 Posted February 15, 2010 Author Posted February 15, 2010 Thanks Lee, But how do i run that to det me the list. I tried a few things but i keep getting errors. Quote
Lee Mac Posted February 15, 2010 Posted February 15, 2010 Thanks Lee, But how do i run that to det me the list. I tried a few things but i keep getting errors. Did you see my example? Quote
woodman78 Posted February 15, 2010 Author Posted February 15, 2010 Yes but I don't see how the bottom code links with that on top. Is the bottom one used to call the code at the top? The top code is setup as a subroutine so do I incorporate that into my own code? Quote
Lee Mac Posted February 15, 2010 Posted February 15, 2010 Yes but I don't see how the bottom code links with that on top. Is the bottom one used to call the code at the top? The top code is setup as a subroutine so do I incorporate that into my own code? Both methods that I have posted are sub-fuctions, the first retrieves the VLA-Object representing the MLeaderStyle; the second retrieves the DXF data list representing that same object. To get such data, the sub-functions must be called with an argument, in this case the MLeaderStyle name. In my example, I called the subfunctions to get the "Standard" MLeaderStyle data. Quote
woodman78 Posted February 15, 2010 Author Posted February 15, 2010 Thanks Lee, That did the job. I got what i needed. Quote
Lee Mac Posted February 15, 2010 Posted February 15, 2010 Thanks Lee, That did the job. I got what i needed. Oh, forgot to mention - the reference for what each of the DXF codes represent is in the VLIDE help files, under MLEADERSTYLE DXF Reference. Quote
woodman78 Posted February 26, 2010 Author Posted February 26, 2010 LeeMac, I looked under the help in vlide but it doesn't give the options available for the codes. Under this heading "MLeaderStyle Context Data Group Codes" there are 2 group codes for text height. I'm a bit lost. Is there any list where it sets out the code and the options available for that code? Thanks. Quote
Lee Mac Posted February 26, 2010 Posted February 26, 2010 All the DXF codes should be listed in the help file. The VL object is probably the easiest to manipulate, look at the return of the first code that I provided, and check the properties and methods in the VLIDE help to see what can be done. Quote
woodman78 Posted February 26, 2010 Author Posted February 26, 2010 Thanks Lee, I found the full list on afralisp.net as a pdf Quote
Lee Mac Posted February 26, 2010 Posted February 26, 2010 Thanks Lee, I found the full list on afralisp.net as a pdf Oh, I didn't realise they put something about it on there - do you have the link? I normally just use the return from vlax-dump-object Quote
woodman78 Posted February 26, 2010 Author Posted February 26, 2010 it's at www.afralisp.net/zip1/dxf.zip Don't know whether this is old or not but wouldn't have thought they would change much would they?? Just looked on google and found the 2009 version: http://images.autodesk.com/adsk/files/acad_dxf.pdf Quote
Lee Mac Posted February 26, 2010 Posted February 26, 2010 Oh, thats just the same that is in the VLIDE help 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.