Lee Mac Posted September 30, 2011 Author Posted September 30, 2011 Following several requests regarding how to modify the program to remove the automatic block rotation, I have updated the program to Version 1.4 to incorporate an option to enable or disable the automatic rotation of the block if a curve object is detected at the block insertion point. The latest version and a full description of the program features can be found here. Lee Quote
yathishkumar Posted October 17, 2014 Posted October 17, 2014 Hi lee, sir could change break on/off like rotate on/off Quote
fathihvac Posted October 19, 2014 Posted October 19, 2014 When deleting the inserted block is it possible to join both end of lines automatically Quote
ttray33y Posted November 18, 2014 Posted November 18, 2014 Hi Master Lee, If possible, is there a chance you can work with your ABB lisp without the Browse dialog box (setq blk (getfiled "Select Block" "" "dwg" 16)) , cuz i am trying to create a script for every block in our database. the script will look something like this. ABB B E:/250M_E_TOOLS/BLOCKS/VAL_BALL.dwg after the script it then Quote
troggarf Posted November 18, 2014 Posted November 18, 2014 When deleting the inserted block is it possible to join both end of lines automatically Use the command EE to start ; by PBE ; http://www.cadtutor.net/forum/showthread.php?73328-Joining-2-commands ; erase a block and join the lines that the block broke (defun c:hint () (if (setq ss (ssget '((0 . "INSERT")))) (repeat (setq i (sslength ss)) (setq pt (cdr (assoc 10 (entget (setq e (ssname ss (setq i (1- i)))) )))) (command "_rotate" e "" "_non" pt "180") ) )(princ) ) (defun c:ee (/ pea $blk block i ll ur objs p1 p2) (vl-load-com) (setq pea (getvar 'Peditaccept)) (setvar 'PeditAccept 1) (if (setq $blk (ssget '((0 . "insert")))) (repeat (setq i (sslength $blk)) (setq e (ssname $blk (setq i (1- i)))) (vla-getboundingbox (vlax-ename->vla-object e) 'll 'ur) (entdel e) (setq objs (ssget "C" (setq p1 (vlax-safearray->list ll)) (setq p2 (vlax-safearray->list ur)) ) ) (if (eq (cdr (assoc 0 (entget (ssname objs 0)))) "LWPOLYLINE") (command "_.pedit" "_m" objs "" "_join" "_Joint" "_Both" (distance p1 p2) "" ) (command "_.join" (ssname objs 0) (ssname objs 1) "") ) ) (princ "\nNo Blocks Selected") ) (setvar 'PeditAccept pea) (princ) ) Quote
Lee Mac Posted November 18, 2014 Author Posted November 18, 2014 Hi Master Lee,If possible, is there a chance you can work with your ABB lisp without the Browse dialog box (setq blk (getfiled "Select Block" "" "dwg" 16)) , cuz i am trying to create a script for every block in our database. the script will look something like this. ABB B E:/250M_E_TOOLS/BLOCKS/VAL_BALL.dwg after the script it then Copy the following code to the end of my AutoBlockBreak file: (defun abb ( blk ins / bse ext pth ) (setq pth (vl-string-translate "/" "\\" (vl-filename-directory blk)) ext (cond ((vl-filename-extension blk)) (".dwg")) bse (vl-filename-base blk) ) (if (not (or (= "" pth) (wcmatch pth "*\\"))) (setq pth (strcat pth "\\")) ) (cond ( (= 4 (logand 4 (cdr (assoc 70 (tblsearch "layer" (getvar 'clayer)))))) (prompt "\nCurrent layer locked.") ) ( (or (tblsearch "block" (setq blk bse)) (setq blk (findfile (strcat pth bse ext)))) (LM:AutoBlockBreak (vlax-vla-object->ename (vla-insertblock (vlax-get-property (LM:acdoc) (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace)) (vlax-3D-point (trans ins 1 0)) blk 1.0 1.0 1.0 0.0 ) ) (= "ON" (getenv "LMac\\ABBRotation")) ) ) ( (prompt "\nBlock not found.")) ) (princ) ) Then, in your Script, call the above function with the name/filename/filepath of the block to be inserted, and the block insertion point, e.g.: (abb "E:/250M_E_TOOLS/BLOCKS/VAL_BALL.dwg" '(1.0 2.0 0.0)) Quote
francois-m Posted November 18, 2014 Posted November 18, 2014 hi lee I use your lisp ABBS at all my project and it's incredible. So i've create a lisp that select block by polyline and i want to add the automatic rotation like your ABBS, but your prog is too difficult for me, can you explain me the automatic rotation? thanks a lot for your job Quote
Lee Mac Posted November 18, 2014 Author Posted November 18, 2014 I use your lisp ABBS at all my project and it's incredible.So i've create a lisp that select block by polyline and i want to add the automatic rotation like your ABBS, but your prog is too difficult for me, can you explain me the automatic rotation? thanks a lot for your job Hi Francois, I'm delighted that you find my AutoBlockBreak program so useful in your work! Regarding the automatic block rotation, the rotation is calculated and set on lines 361-376 (inclusive) of the code - here, variable 'ent' is the block reference entity, and variable 'crv' is the curve entity (line/arc/circle/polyline/spline etc.) to which the block should be aligned. Lee Quote
ttray33y Posted November 18, 2014 Posted November 18, 2014 (edited) Lee, man you are God like... is there a bar near your place, i want to order a case of beer for you dude. however, i cant seem to make it work. please teach me on where to insert the (abb "E:/250M_E_TOOLS/BLOCKS/VAL_BALL.dwg" '(1.0 2.0 0.0)) -------- got it Lord Lee. many thanks from me & my staff.. cheers Edited November 19, 2014 by ttray33y Quote
Lee Mac Posted November 19, 2014 Author Posted November 19, 2014 Lee, man you are God like... is there a bar near your place, i want to order a case of beer for you dude. Cheers ttray, you're too kind however, i cant seem to make it work. please teach me on where to insert the (abb "E:/250M_E_TOOLS/BLOCKS/VAL_BALL.dwg" '(1.0 2.0 0.0)) After you have copied the abb function definition (the larger code portion) to the AutoBlockBreak LISP file, the single line to call the function should go in your Script file, e.g. the Script would be something like: _.open C:/YourDrawing.dwg (load "AutoBlockBreakV1-6.lsp" nil) (if abb (abb "E:/250M_E_TOOLS/BLOCKS/VAL_BALL.dwg" '(1.0 2.0 0.0))) _.qsave _.close Lee Quote
ttray33y Posted November 19, 2014 Posted November 19, 2014 how about (if abb (abb "E:/250M_E_TOOLS/BLOCKS/VAL_BALL.dwg" '[b][color=red](1.0 2.0 0.0)[/color][/b])) to replace the insertion point with getpoint Quote
Lee Mac Posted November 20, 2014 Author Posted November 20, 2014 Sorry, I'm not sure that I quite understand your question? Quote
ttray33y Posted November 21, 2014 Posted November 21, 2014 Sorry, I'm not sure that I quite understand your question? hi Lee, sorry i forgot to update you, i already fix that, however i have 1 more prob regarding ABB. When inserting block in a polyline with Globalwidth the auto rotate function cant seem to recognize the polyline. notice the Global width of the 2 polylines and the valve symbol on the PL with GW. Note: rotation is ON Quote
Lee Mac Posted November 22, 2014 Author Posted November 22, 2014 When inserting block in a polyline with Globalwidth the auto rotate function cant seem to recognize the polyline. Thank you for bringing this to my attention, I have now updated the program to V1.7 to hopefully fix this issue. Please try the new version available here. Lee Quote
ttray33y Posted November 23, 2014 Posted November 23, 2014 Thank you for bringing this to my attention, I have now updated the program to V1.7 to hopefully fix this issue. Please try the new version available here. Lee Lee, its wokring!. many thanks from phils. Quote
Lee Mac Posted November 24, 2014 Author Posted November 24, 2014 Lee, its wokring!. many thanks from phils. Excellent to hear! You're most welcome. Quote
ttray33y Posted April 27, 2015 Posted April 27, 2015 Excellent to hear! You're most welcome. (if abb (abb "E:/250M_E_TOOLS/BLOCKS/VAL_BALL.dwg" '(1.0 2.0 0.0))) in (1.0 2.0 0.0) is there any alternative where i can somewhat choose where i want to it insert it, like PAUSE. TIA Quote
Lee Mac Posted April 27, 2015 Author Posted April 27, 2015 (if abb (abb "E:/250M_E_TOOLS/BLOCKS/VAL_BALL.dwg" '(1.0 2.0 0.0))) in (1.0 2.0 0.0) is there any alternative where i can somewhat choose where i want to it insert it, like PAUSE. You could use: ((lambda ( / ins ) (if (and abb (setq ins (getpoint "\nSpecify insertion point: "))) (abb "E:/250M_E_TOOLS/BLOCKS/VAL_BALL.dwg" ins)))) Quote
ttray33y Posted April 27, 2015 Posted April 27, 2015 You could use: ((lambda ( / ins ) (if (and abb (setq ins (getpoint "\nSpecify insertion point: "))) (abb "E:/250M_E_TOOLS/BLOCKS/VAL_BALL.dwg" ins)))) Lee, its perfect. thanks! 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.