Jump to content

Force Open arrowheads to Solids always...


shailujp

Recommended Posts

Hi folks,

 

I need help on fixing the arrowhead.

 

Some drawings come with default setting for Arrowheads as OPEN. When I run an utility (which inserts a leader with custom texts as a block), it inserts arrowheads as open. My requirement is to add Solid arrowheads always. I tried to force it via below code but its not forcing. Can anyone suggest?

 

What could be wrong?

 

 
(defun Addleader (/ pt1)

  (setvar "DIMLDRBLK" ".")
         (while
            (setq pt1 (getpoint "\nInserting task description note, Specify Arrow End Point or hit Enter to close:"))
     (Command "_INSERT" "CP TEXT" pt1 "" "" "")
       (command "explode" "l")
          );end while
) ;end defun 

 

EDIT: I think it has to do something with the default DIMSTYLE. And the block I'm trying to insert it on the Standard dim style. Not sure how to handle this.

Edited by shailujp
Link to comment
Share on other sites

I think I agree on this, but is there a way to write DIMLDRBLK . (dot) via lisp which forces it to be default value instead of Open. Is my current code correct that way its written? Also when I change the setting, the Standard style change to Standard (override). The block that I'm trying to insert has a leader on the Standard. This is what I think its not working. Do you agree?

 

Or should I change the leader on the block drawing to be Standard (overrides) to be able to match the style?

 

Also, how do you write "" via lisp to change DIMLDRBLK it to solids via lisp? Like this """"?

Link to comment
Share on other sites

I think this idea works. I just need to test it on few drawings to see if it works 100% or not. I will keep you posted on this.

 

Thanks much.

Link to comment
Share on other sites

I think this idea works. I just need to test it on few drawings to see if it works 100% or not. I will keep you posted on this.

 

Thanks much.

 

Would love to know the outcome after all :)

Link to comment
Share on other sites

Tharwat,

 

Here is how it worked finally based on your suggestion. Since I was inserting a block (which I forced to be a solid leader on the original block drawing), I had to add a purge command to purge existing block (which is exploded anyways right after the insertion thus safe/allowed to purge). I was trying on the existing drawing that time I realized why it was not working on all drawings. But purging did the trick for me.

 

 
(if (tblsearch "BLOCK" "CP TEXT")
    (command "_purge" "B" "CP TEXT" "N")
)

 

Thanks for your help.

Link to comment
Share on other sites

One last hurdle,

 

How do I find all existing leaders which are on a perticular layer and change it to solid arrowheads?

 

This is a fix that I may have to run on all existing drawings done so far.

Link to comment
Share on other sites

One last hurdle,

 

How do I find all existing leaders which are on a perticular layer and change it to solid arrowheads?

 

This is a fix that I may have to run on all existing drawings done so far.

 

Use one of these ITERATIONS that been written by Lee with the function that I have indicated to you above earlier .

e.g.

 

(vla-put-ArrowheadBlock <Vla-Object> "")

Link to comment
Share on other sites

Here is what I was able to do which just works.

It works but not sure why I have 'ldr' and 'o' both variables.

Any suggestions?

 

 

 
(defun C:ARWFIX (/ ldr)
  (if (setq ldr (ssget "_x" '((0 . "LEADER")(8 . "CONSTRUCTION"))))
       (progn
           (vlax-for o (setq ldr (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object))))
           (vla-put-ArrowheadBlock o "")
           )
           (vla-delete ldr)
       )
   )
   (princ)
)
(vl-load-com) (princ)

Link to comment
Share on other sites

The first variable is not needed which is ldr since that you have chosen to use the vla-get-activeselectionset function and the other variable 'o' is for counting through the selection set entities and should not be localized as you have did .

Link to comment
Share on other sites

This one is way of the top of my head. Can you modify the code for me please?

 

Nothing is wrong at all but just unneeded duplicate of the variable , so if you want to modify it , just remove the variable which is 'ldr' as shown below .

 

(if (ssget "_x" '((0 . "LEADER")(8 . "CONSTRUCTION")))
         ( ..................

Link to comment
Share on other sites

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