Jump to content

Recommended Posts

Posted

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

Posted

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")

Posted

Thanks Lee,

 

But how do i run that to det me the list. I tried a few things but i keep getting errors.

Posted
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?

Posted

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?

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

Posted

Thanks Lee, That did the job. I got what i needed.

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

  • 2 weeks later...
Posted

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.

Posted

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.

Posted

Thanks Lee, I found the full list on afralisp.net as a pdf

Posted
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

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