Jump to content

Recommended Posts

Posted (edited)

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
Posted

The DIMLDRBLK works on new created leaders and you have inserted the leader as a block , so logically could not be changed .

Posted

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

Posted

You can read about the function vla-put-ArrowheadBlock then set the value to null string ( as in your case for the ClosedSolidArrowHeads )

Posted

Why do not you change the property of the leader in the block then you can have the leader with the setting you want even after exploding.

Posted

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.

Posted
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 :)

Posted

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.

Posted

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.

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

Posted

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)

Posted

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 .

Posted

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

Posted
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")))
         ( ..................

Posted

Thank you very much Tharwat. Appriciate your help.

Posted
Thank you very much Tharwat. Appriciate your help.

You're welcome anytime .

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