Search the Community
Showing results for tags 'wblock'.
Found 14 results
Redefining Blocks when inserting into a drawing from a block library.
sarah.casey@ffeconsulting. posted a topic in AutoCAD Drawing Management & OutputHi all, If I edit a block definition in one file, is it possible to update all instances of the block in another file? I have tried to insert my updated block definition into another file where the block is used multiple times, but it just inserts it as the old definition in that drawing. Can I redefine the block and replace all instances of it with the new updated version? trying to find a productive workflow that doesn't make me want to pull my hair out! thanks in advance. SC
Plot Range of PDFs
Tirdad posted a topic in AutoLISP, Visual LISP & DCLHello there! since you're so popular I need your help. Here is my code and I need it to generate PDF only for it's job, like I have 50 pages and actually what I have here selects one page block (reads it's entity) and generates all the 50 pages, but I need to get PDF from like 25 of them not all of them! it needs to PDF ALL AT ONCE, page by page (with PDF Factory Pro Printer) Here it is : (defun c:epdf (/ ob ss bn mn mx) (vl-load-com) (setq cnt 0) (setq dir (getvar "dwgprefix")) (if (and (progn (initget "B") (setq ob (entsel "\nSelect Block/B for blockname: ")) (cond ((eq ob "B") (setq bn (getstring "\nEtner Block Name: ")) ) ((and (eq (type ob) 'LIST) (vlax-method-applicable-p (vlax-ename->vla-object (car ob)) 'getboundingbox ) ) (setq bn (cdr (assoc 2 (entget (car ob))))) ) ) ) (tblsearch "BLOCK" bn) bn (setq ss (ssget "_X" (list '(0 . "INSERT") '(410 . "Model") (cons 2 bn)) ) ) ) (progn (vla-zoomextents (vlax-get-acad-object)) (repeat (setq i (sslength ss)) (setq ML "Material-List") (setq cnt (1+ cnt)) (vla-getboundingbox (vlax-ename->vla-object (ssname ss (setq i (1- i)))) 'mn 'mx ) (command "plot" "yes" "model" "DWG To PDF.pc3" "ANSI A (8.50 x 11.00 Inches)" "inches" "LANDSCAPE" "no" "Window" (trans (vlax-safearray->list mn) 0 1) (trans (vlax-safearray->list mx) 0 1) "fit" "center" "yes" "monochrome.ctb" "yes" "As Displayed" (strcat dir "ML-" (itoa cnt) "-" (getvar "dwgname")) "no" "yes" "yes" "yes" ) (command ".delay" "750") ) ) (princ "\nNo Blocks Selected: ") ) (princ) )
WBlock + xref
Tim S posted a topic in AutoCAD LTIs there a way to create a block that includes xref files? WBlock only includes the DWG and not the xref.
Script file to write entire set of drawings to a a new folder using WBLOCK
conradsteve posted a topic in AutoLISP, Visual LISP & DCLHi, I have this batch file that opens each drawing in a specific folder, does a purge on each file, then saves and closes it. What I'd like to do is add a WBLOCK command to that script file that would write the entire drawing to a designated folder, but instead of calling the new file 'new block.dwg' (which is the default name), it would use the same name as the original. Below are a few lines from the script file and I'd like to insert the WBLOCK command after the purges. Is that possible? Many thanks _open "U:\Project\A - CURRENT DRAWINGS\TitleBlock.dwg" _purge all * no _purge all * no _purge all * no _zoom extents _qsave _close
Block Tool Palette Lag Problem
eyeofnewt555 posted a topic in AutoCAD Drawing Management & OutputHey folks! Looking to confirm or debunk some assumptions I've developed after creating and testing multiple iterations of different block tool palettes. From what I've seen, user-created block tool palettes will either be fully functional (~3 seconds from clicking on the icon to insertion in the drawing) or prohibitively slow (~45s) depending on how they were created. Method 1: If the blocks are added to the palette from any old drawing (either by dragging and dropping from model space or from the design center), pulling them back out of the palette takes a million years. Method 2: If the blocks in the source file are WBlocked out (resulting in many blocks in one WBlocked dwg) and then added to the palette from that single WBlocked dwg (which will never get opened and altered without WBlocking again) via the design center, then the palette moves quickly. I guess this improvement in speed is from the "shrinkwrapping"/purging/fat trimming that happens when you WBlock. From what I can tell, it seems that ACAD's native palettes are created along these lines. I'm fine with using method 2 to make my palettes, but I first wanted to double check that method 1 isn't viable. In videos like this they seem to use method 1 just fine with no significant lag. So, have I just overlooked some process/setting that would make method 1 work without the lag? More info: I am on a network, but I've tested everything on my local drive and the results seem to be the same, so I'm doubtful that the lag is network-related. Any feedback appreciated. Thanks! Also: I have a small sample tool palette created using the different methods in case anyone wants to test it on their machine. Just lemme know.
create separate drawing for more object
malkasun posted a topic in AutoLISP, Visual LISP & DCLI have an AutoCAD drawing. There are 100 road cross sections in that drawing. I want to make 100 separate drawings using those 100 road cross sections. I use Wblock command for that. but it is very hard to rename one by one while using that command. If you can teach me a way to rename them automatically. the windows can be selected when using that command. I want to get those files to a predefined folder with automatically renamed. Is there a way to do that? otherwise please write a lisp program for me. I don't know how to do that. How to use a file list in an Excel sheet as the names which use for auto renaming?
Wblock dialog box
chiimayred posted a topic in AutoLISP, Visual LISP & DCLhey guys, I am working on converting some 3d solids into usable 2D dynamic blocks and I am working on writing a quick little lisp that will help speed it up. (defun c:test (/ obj obj2 bp name) (setq obj (entsel)) (command "_-view" "_top" "flatshot" '(0 0) 1 1 0 "_erase" obj "" "_explode" "_all" ) (setq obj2 (ssget)) (setq bp (getpoint "\nWhere is basepoint?: ")) (setq name (getstring T "\nWhat is the name of the block?: ")) (command "_block" name bp obj2 "" "_insert" name '(0 0) 1 1 0 "wblock" ) ) my issue is with the wblock command, is there a way to get the dialog box to open? if not i need to export the block file to a different file path (not every time but most)... what would be your approach? Thanks!
Wblock lisp to save to a autocad default
BrianTFC posted a topic in AutoLISP, Visual LISP & DCLLee Mac wrote this awesome lisp routine to be able to select multiple objects and wblock block them out as separate drawings, which works great. My problem i'm having is the program that i'm using for my router was written in 2010 and won't except the 2013 file's and for some reason wblock won't except the autocad default when i run the lisp routine, it saves them to 2013. I was wondering if someone could help me with this i would really appreciate it. Thanks again, Brian ;; WBlock Rectangles - Lee Mac ;; For improved performance, disable DWG thumbnail generation (defun c:wbr ( / app blk cpy dir doc dwg err in1 in2 llp lst mid obj org sel ssc sso tmp urp ) (setvar 'cmdecho 0) (if (setq sel (ssget "_:L" '((0 . "LWPOLYLINE")))) (progn (setq app (vlax-get-acad-object) doc (vla-get-activedocument app) ssc (vla-get-selectionsets doc) sso (vl-catch-all-apply 'vla-item (list ssc "wbr-sel")) org (vlax-3D-point 0 0) dir (getvar 'dwgprefix) ) (if (vl-catch-all-error-p sso) (setq sso (vla-add ssc "wbr-sel")) ) (vla-zoomextents app) (repeat (setq in1 (sslength sel)) (setq obj (vlax-ename->vla-object (ssname sel (setq in1 (1- in1))))) (vla-getboundingbox obj 'llp 'urp) (setq llp (vlax-safearray->list llp) urp (vlax-safearray->list urp) mid (vlax-3D-point (mapcar '(lambda ( a b ) (/ (+ a b) 2.0)) llp urp)) ) (vla-clear sso) (if (setq tmp (ssget "_C" (trans urp 0 1) (trans llp 0 1))) (progn (repeat (setq in2 (sslength tmp)) (setq cpy (vla-copy (vlax-ename->vla-object (ssname tmp (setq in2 (1- in2))))) lst (cons cpy lst) ) (vla-move cpy mid org) (if (= "AcDbText" (vla-get-objectname cpy)) (setq blk (vla-get-textstring cpy)) ) ) (cond ( (null blk)) ( (not (snvalid blk)) (princ (strcat "\nInvalid block name \"" blk "\".")) ) ( (findfile (setq dwg (strcat dir blk ".dwg"))) (princ (strcat "\n" dwg " already exists.")) ) ( (progn (vlax-invoke sso 'additems lst) (vl-catch-all-error-p (setq err (vl-catch-all-apply 'vla-wblock (list doc dwg sso)))) ) (princ (strcat "\nError creating drawing: " dwg "\nDetail: " (vl-catch-all-error-message err) ) ) ) ) (foreach obj lst (vla-delete obj)) (setq lst nil blk nil ) ) ) ) (vla-zoomprevious app) (vla-delete sso) ) (setvar 'cmdecho 1) ) (princ) ) (vl-load-com) (princ)
Bogus Linetypes unable to purge
3dwannab posted a topic in AutoCAD Drawing Management & OutputSee attached dwg with a basic layer, dim style and text style template. See that there are linetypes which I can't purge. _TEMP.dwg Linetypes are for example: 4382_F_08-10 GA Elevations$0$4382_F_1000-1 Lower Ground Floor Plan$0$ceiling details - Model$0$SW-CA-ZZZZ-ZZZ-2SC-AR-063001_Section4-4 - Default$0$AUSGEZOGEN That's just one name and there is over a hundred similar ones! Maybe the name is too long for ACAD to handle? Things I've tried. wblock selected to new .dwg audit, purge and audit, purge again. Copy and pasting into blank template. Step 2. 10+ years in AutoCAD and haven't came accross this before. Any ideas? Thanks. EDIT (A sort of fix) Got a great LISP from Lee Mac to steal layers, dimensions and Text styles from the drawing. As long as I didn't take in the Linetypes I was fine. This LISP does a whole lot more than the things described above. Visit: http://www.lee-mac.com/steal.html
Block by windowing lisp
BrianTFC posted a topic in AutoLISP, Visual LISP & DCLHi All, What i'm looking to do is block multiple objects by windowing all of them at once and have them save as sepearate blocks and using the label in the middle as the block name. I guess the big question is it even possible to do this? Brian block dwg.dwg
Thumbnail preview not showing in Explorer
garygoude posted a topic in AutoCAD GeneralRecently starting having this problem. 1-2 months ago it was not a problem. I am not aware of any system variables being changed. When using the WBLOCK command, no thumbnail preview is being saved with the block for previewing in Windows Explorer. I have check the RASTERPREVIEW system variable is set to 1, but this makes no difference. When saving files normally I do not have a problem. The block previews are very useful for my day to day work, so if anyone can help I will be very grateful. Using AutoCAD 2011. Thanks, Gary
aquidea posted a topic in AutoCAD Bugs, Error Messages & QuirksDear All, I've problem with Wblock command. I draw some drawings in file but when i try to save in Wblock command that does not work. This is notification about that. "Wblock operation rejected due to a proxy object that does not allow copying". What wrong with this? Any ideas for solve this problem. Thank you... Best regards
How did they do it? A Mysterious Block Locked for Editing
Wavey posted a topic in AutoCAD Drawing Management & OutputI was very intrigued by a customer/clients DWG. It had all these, 'equipment envelopes'. They were blocks that were locked from editing/exploding. There were many of them. I could REFEDIT and save/discard changes, but that changed all the blocks. I noticed that the block had two 'parts', in the REFEDIT it appeard to have two files, a block within a block. I finally realized wblock (save block as) would allow me to actually 'get into' the block. So, that problem is solved (thanks in part to this website and its tutorials/forums). I'm still very curious, however. How did they do that?
4" Tee pipe problem
Grover121 posted a topic in AutoCAD GeneralHello, I'm currently taking a Basic AutoCad class at school. I just got assigned a group project where everyone draws an assigned 2D wblock and when the class is finished we're going to piece the wblocks together to make one large drawing. I know how to make the wblock but my problem is I don't understand these dimensions or how to use them to make my drawing in AutoCad and was hoping I could get some help here. I am assigned to draw a 4" Tee pipe (2D) and I have a sheet of poorly scanned paper with a table giving me the Nominal Pipe Size, Outside Diameter, Center to End of Run, Center to End of (I think it says Branch? it's very poorly scanned so it has a smudge over the letter next to the "B" so it looks like B?anch). I really have no idea on how to go about this and it is due tomorrow night at the end of class. Under the Nominal Pipe Size category the dimensions that pertain to 4 are: Outside Diameter: 4.500 Center to End of Run: 4 1/8 Center to End of B?anch: 4 1/8 If I recall correctly our teacher told us to round off the numbers to 4 which doesn't make any sense at all to me. Any help at all is appreciated.