Jump to content

Multileader without fields - Lee Mac Block Attributes To Multileader edit


Recommended Posts

Posted

Hello,

 

is there any chance to remove field reference with Lee Mac lisp for Block Attributes to multileader? Now multileader makes fields and I need just simple text. I attached full lisp and text DWG. I will appreciate for help with LISP.

 

Marcin

 

                        (vla-put-textstring mld
                            (strcat
                                (if (= "" (vla-get-textstring at1))
                                    ""
                                    (strcat
                                        "%<\\AcObjProp Object(%<\\_ObjId "
                                        (LM:ObjectID at1)
                                        ">%).TextString>%"
                                        (if (= "" (vla-get-textstring at2)) "" (chr 10))
                                    )
                                )
                                (if (= "" (vla-get-textstring at2))
                                    ""
                                    (strcat
                                        "%<\\AcObjProp Object(%<\\_ObjId "
                                        (LM:ObjectID at2)
                                        ">%).TextString>%"
                                    )
                                )
                            )
                        )

 

obraz.thumb.png.faadd0cecceb1fab05e2fe5364d2f734.png

 

BlockAttributesToMultileader-test.dwg BlockAttributesToMultileader.lsp

Posted

Sunday so CAD is off here.... not checked my answer but if you comment out for example:

"%<\\AcObjProp Object(%<\\_ObjId "
(LM:ObjectID at1)
">%).TextString>%"
(if (= "" (vla-get-textstring at2)) "" (chr 10))

 

(comment out rather than delete in case that doesn't work and you need to go back again)

 

and  replace with

 

TextString
(if (= "" (vla-get-textstring at2)) "" (chr 10))

 

and for the second case, if doesn't have the (if statement at the end of course

 

Posted

Hello Steven,

thank You for post. I've checked it but unfortunately it returns multileader without content. Console says "error: bad argument type: stringp nil".

Posted (edited)

Ah, it might be (vla-get-textstring at1) that you need to use (and (vla-get-textstring at2) instead of TextString

Edited by Steven P
  • Like 1
Posted

Hi Steven,

Thank You very much it worked :)

  • Like 1

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