shailujp Posted December 23, 2013 Posted December 23, 2013 (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 December 23, 2013 by shailujp Quote
Tharwat Posted December 23, 2013 Posted December 23, 2013 The DIMLDRBLK works on new created leaders and you have inserted the leader as a block , so logically could not be changed . Quote
shailujp Posted December 23, 2013 Author Posted December 23, 2013 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 """"? Quote
Tharwat Posted December 23, 2013 Posted December 23, 2013 You can read about the function vla-put-ArrowheadBlock then set the value to null string ( as in your case for the ClosedSolidArrowHeads ) Quote
Tharwat Posted December 23, 2013 Posted December 23, 2013 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. Quote
shailujp Posted December 24, 2013 Author Posted December 24, 2013 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. Quote
Tharwat Posted December 24, 2013 Posted December 24, 2013 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 Quote
shailujp Posted December 26, 2013 Author Posted December 26, 2013 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. Quote
Tharwat Posted December 26, 2013 Posted December 26, 2013 Happy to know that you got it working as needed . Best of luck . Quote
shailujp Posted December 26, 2013 Author Posted December 26, 2013 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. Quote
Tharwat Posted December 26, 2013 Posted December 26, 2013 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> "") Quote
shailujp Posted December 26, 2013 Author Posted December 26, 2013 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) Quote
Tharwat Posted December 26, 2013 Posted December 26, 2013 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 . Quote
shailujp Posted December 26, 2013 Author Posted December 26, 2013 This one is way of the top of my head. Can you modify the code for me please? Quote
Tharwat Posted December 26, 2013 Posted December 26, 2013 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"))) ( .................. Quote
shailujp Posted December 26, 2013 Author Posted December 26, 2013 Thank you very much Tharwat. Appriciate your help. Quote
Tharwat Posted December 26, 2013 Posted December 26, 2013 Thank you very much Tharwat. Appriciate your help. You're welcome anytime . 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.