Search the Community
Showing results for tags 'insert'.
-
Insert a block based upon search/found criteria?
ILoveMadoka posted a topic in AutoLISP, Visual LISP & DCL
Up til now I have had 3 separate routines for inserting a block based upon the existence of an inserted block in a drawing. (if (tblsearch "BLOCK" "BlockA") (command "-insert" "Block1" "0,0" "" "" "")) (if (tblsearch "BLOCK" "BlockB") (command "-insert" "Block2" "0,0" "" "" "")) (if (tblsearch "BLOCK" "BlockC") (command "-insert" "Block3" "0,0" "" "" "")) I was wanting to combine them into a single routine similar to this; (defun c:foo () (cond (if (tblsearch "BLOCK" "BlockA") (command "-insert" "Block1" "0,0" "" "" "")) (if (tblsearch "BLOCK" "BlockB") (command "-insert" "Block2" "0,0" "" "" "")) (if (tblsearch "BLOCK" "BlockC") (command "-insert" "Block3" "0,0" "" "" "")) ) (princ)) [Which does not work correctly BTW - it does not go beyond the first step] I also wondered "what if more than one block exists?" Ideally only one of these blocks "should" exist in a drawing in my situation. How can I test for the existence of more than one block first and return an error if found or insert the appropriate block meeting the criteria otherwise? I read about using wcmatch if I set (setq myblks (list "BlockA" "BlockB" "BlockC")) Not sure how to incorporate that if it is the better way I have pieces and parts but cannot put it together Help please.. ps: When using multiple searches, how to you proceed to the next search if the criteria is not met? (if (tblsearch "BLOCK" "BlockA") (command "-insert" "Block1" "0,0" "" "" "")) -
I need help in debugging the following code: (defun c:spool_labels ( / prefix cnt pt ol) (setq prefix (getstring t "\nENTER PREFIX: ") cnt (getint "\nENTER INTEGER TO START: ") ;; value to start the counter at ol (getvar 'clayer) oa (getvar 'attdia) ) ;; Turn dialog off for the attributes (setvar 'attdia 0) ;; Create layer for the blocks to be inserted on (command "-layer" "make" "Blocks-Spool Label" "color" "magenta" "" "") (while (setq pt (getpoint "\nPICK INSERTION POINT: ")) ;; get insertion point for block (command ".-insert" ;; command to insert a dynamic block "_MP Spool Label" ;; name of block to insert pt ;; insertion point for block 1 ;; scale value for the block 0 ;; rotation value for the block ;; concatenate the prefix to the counter for the name (strcase (strcat prefix (itoa cnt))) ) ;; increment the counter (setq cnt (1+ cnt)) ) ;; restore change system values (setvar 'clayer ol) (setvar 'attdia ol) (princ) ) The output of the code: Command: SPOOL_LABELS ENTER PREFIX: 4" CND # ENTER INTEGER TO START: 1 PICK INSERTION POINT: Unknown command "\". Press F1 for help. Block gets inserted but the attribute does not get filled in. Any help with this will be greatly appreciated.
-
Hello, i try to insert block view in dcl format. I want when i chose block name to have block view to. Something like this.
-
In continuation of this thread I would like to continue this interesting story about UCSs and transformed entities. So far I have understood ( I am thankful to the community here) that An OCS is an coordinate system that most of the Autocad entities use instead of any other CS An OCS share the same origin with the WCS, however its x,y,z may be other than the one of the WCS However, it seems that something still eludes me and I cannot fully grasp it. I made a very simple model with a line drawn in WCS from 0,0,0 to 1,2,3. I would like to insert the same model on this one, that is having this line sitting on the end point (1,2,3) of the other as an extension. That means the lines need to be collinear. Let's assume I mirror3d this line on the xy plane, so the extrusion vector now becomes 0.0 0.0 -1.0. Using the following snippet the line comes on the correct placement but the orientation is wrong. What am I missing? ; clicking the mirrored entity from 0,0,0 to 1,2,-3 (setq pt (cdr (assoc 11 (setq ent (entget (car (entsel))))))) (setq v (cdr (assoc 210 ent))) ; inserting the drawing (entmakex (list (cons 0 "INSERT") (cons 2 "Dwg") (cons 8 "0") (cons 10 (trans (trans pt 0 1) 1 v)) (cons 70 0) (cons 66 1) (cons 50 0) (cons 210 v) ) ) Any suggestions appreciated.
-
Count Specific Block Name and Insert Block to Coords Depending on Block Count
kylaughlan posted a topic in AutoLISP, Visual LISP & DCL
Hi there, I'm looking for a Lisp routine that can count the number of one specific nested block (it will always have the same name) within a single layout, and then automatically insert the same block (which doesn't need to be nested) to differing coordinates depending on how many of that block there already is. I am having doubts to whether this would even be possible but I thought I would ask. Seeing as nested blocks can be counted through Lisp, I figured it might be possible. I've began to explore the world of Lisp and am using a few different routines currently. They work great but I am nowhere near at a stage where I can write a detailed Lisp routine myself. [using AutoCAD 2017 full version] Thanks guys, Kyle -
Inserted Pdf table is shown as link address in new open
khoshravan posted a topic in AutoCAD Drawing Management & Output
I inserted a pdf file (table) and printed it out. Now that I want to open the file again, the table is gone and its address is shown instead. What is wrong and how can I keep the table as the first time? -
inserting dynamic block in to model space
srini posted a topic in AutoCAD Drawing Management & Output
i remember in my old company, i used to insert dynamic block from tool palette. I use to select two points on model space to select the length of beam i needed. how to do that ? I made blocks, but when i insert, a window opens up and asks for length. I want to select two points on model space to specify the length of beam, instead of entering the length in numbers.- 4 replies
-
- insert
- dynamic block
-
(and 1 more)
Tagged with:
-
Hi, I search for Lisp for insert block faster. Ex.: if a write "1" on keyboard, i can insert "block 1" in my drawing. I can insert "block 1" until a stop the LISP if a write "2" on keyboard, i can insert "block 2" in my drawing. I can insert "block 2" until a stop the LISP All my block are in the same drawing. Thanks a lot
-
Is there a command in place already or a lisp that can give you time and date of when any selected object was inserted in a dwg? Thanks, -Nobull
-
Insert Excel Sheet into CAD File.
tipu_sultane posted a topic in AutoCAD Drawing Management & Output
How to insert the Excel File in CAD file. I am using AutoCAD 2012. I used io command and try to attach file by browse tab, but facing two problems. 1.) The attached file result display not full sheet i.e not all rows and columns that I want to display in CAD file. 2.) It only attaches the first sheet from the file. i.e If I want to attached other sheet from the same file what to do. Thanks. -
Insert Blocks off of List with Attributes and Rotate the Blocks when inserted
numberOCD posted a topic in AutoLISP, Visual LISP & DCL
Good Morning, I am brand new to AutoLISP and am not picking it up quite as well. I'm trying to make a LISP that will insert around 1500 blocks at designated coordinates off a list I will make in Excel (or can transfer to a txt). The excel list will have X,Y coordinates, an angle of rotation, and 2 or 3 attributes. This LISP will not be for a long time use, it's mainly to get a large insertion completed for editing as construction comes along, so I only need to make it for functional purpose. If someone can guide me better in how to extract the information from the list into the LISP, that's the main thing I'm having trouble picking up. Thanks for any help! -
When inserting vertex in pline, jump to the new vertex
DieterBvH posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
Hi everyone, I guess I messed up some strange option in AutoCAD here. For my job, I often need to add a number of vertices to a 2D Polyline / edit polylines. Until a couple of days ago, when inserting a new vertex to a polyline, it automatically jumped to the new vertex, so I would add a number of vertices by only using the (insert) command. But now, when inserting a new vertex in a polyline, the X stays on the original vertex, the vertex selected before inserting the new one. So when inserting a number of vertices, I have to press , then (next) for every vertex inserted. The way vertices get inserted now is as if you insert a vertex by pressing , then press for previous so the X jumps back to the original. I'd like to insert a couple of vertices without pressing each time! I have tried to find this option but couldn't find it anywhere. (pline options? Pedit options?) I am using AutoCAD 2010, no mouse commands (only keyboard). Hope someone can help me out here, thx in advance! EDIT: English + more thorough explanaition... -
Hello, well i need your help for a college project.. i have a map from an abandoned camp in the suburbs of the city and i have to make a 'digitization' (maybe through Raster Image??!!) into AutoCAD (im working on Autocad 08) ... Can someone help me and write some kind "directions" on how to do this?! Thanks in advance!
- 4 replies
-
- insert jpeg
- insert
-
(and 3 more)
Tagged with:
-
I inserted our company logo and placed It properly in our title block. But when I zoom in with the mouse wheel the logo gets smaller in the border. When I zoom out it increases bigger than the border. Any help would be greatly appreciated.... I hope I am just missing a small option..
-
Help needed with custom Macro command
garygoude posted a topic in The CUI, Hatches, Linetypes, Scripts & Macros
I have generated the following Macro in a drop down menu for quick insertion of some of my company's standard blocks. I want to know how to add the function explode to the command so as soon as I have placed the block using the macro it exploded on placement or selection of the macro. ^C^C-insert;F:/Blocks/CAN.dwg -
Having Copy paste issues any assistance would be greatly appreaciated
mikewa posted a topic in AutoCAD Beginners' Area
we switched from civil 3d 2012 to 2014 and since we switched my copyclip (ctrlv or right click ) will work for the first few times then after that it will say "duplicate definition of block XX ignored Substituting [simplex.shx] for [TB.shx]. Substituting [simplex.shx] for [GB-LD.SHX]. Substituting [simplex.shx] for [TC-ROMND.SHX]. this happens when pasting the same item in that ive already pasted in 2-3 layouts and once this starts happening i cant copy paste at all untill i shutdown autocad and reset my computer (which only works like 30% of the time) also this would happen regardless of what the object is i could draw a line and not be able to copy paste it. and another thing it does when this starts happening is it creates a few dozen random blocks *A2556 etc etc that i have to purge out. please help me with this issue ive managed to figure out/deal with all the other issues autocad 2014 has brought to us but this one i cant figure out for the life of me and its not just my computer it happens on all of them and happens even if you start a project with nothing -
Creating a dynamic block with attribute definition
KoTa04 posted a topic in AutoCAD Drawing Management & Output
Hi All, I'm having trouble getting my attribute definitions to work with my blocks. I'm trying to create a tag that can flip around (dynamic) and have a tag number easily entered (attribute). I notice that I could only get the attribute definition to work during a drawing insertion is when I wblocked out my block and inserted that drawing file. I was not able to insert the drawing file that had the block in it. I can't seem to make a dynamic block drawing file, and then insert that dynamic block drawing file if I want the attribute to work.. Do you understand?? EDIT: I got it after more fidgeting...- 4 replies
-
- dynamic block
- attribute
-
(and 1 more)
Tagged with:
-
What an extended absence . But of course there is more to this post. A while back I made an icon so that the drafters in my company could put the right border in the right spot with a click of the mouse. here was my macro: (command ".insert" "I:/borders/11x17" "0,0" "1" "1" "0") This inserts the border on the drawing at coordinates 0,0 at a scale of 1 and a rotation of 0 degrees. But if i wanted to make this where you had to choose an insertion point, how would i go about doing that? my first thought is: (command ".insert" "I:/borders/11x17" "0" "1" "0") is this close?
-
Attaching an Xref to my title block
ktcollardson posted a topic in AutoCAD Drawing Management & Output
Hello - I am trying to attach the client details as an xref to my title block. This is how it was done at my previous company, but I did not set that up, so I don't know how it was done. The problem is this - when I attach the xref, I cannot see it on my page in paper space. If I zoom out as far as possible, the paper layout becomes a tiny dot on the screen. When I then draw a rectangle far to the right of the paper, I see a blue glyph on my paper, so I know that the drawing is there, but I cannot see it (the drawing is inserting very far to the right). I would like to figure out how to insert my xref so that it shows up on my page. I have moved the information in the file to 0,0 and inserted at 0,0, but I keep having the same problem. Does this description make sense? Is anyone able to help? Thank you!- 4 replies
-
- title block
- insert
-
(and 1 more)
Tagged with:
-
Hi everyone, So I just upgraded to MEP 2013 last week and am in a bad situation where when I keep making my data link tables to a range on an excel table the file name's full address is not staying when I go to insert the table. (ex. D:/Documents/JB Plans/NK.xlsm is just NK.xlsm when I try to insert the table) Does anybody know of some defaulting or setting that I haven't found involving this issue? Thanks
-
Does everyone know how to insert xrefs with other ucs than world. The host drawing ucs must be in world. The different x-refs are made with different ucs according to local coordinates. In the host drawing, the xrefs must be placed correctly according to global coordinate (world). (The xrefs are all surveys of different spaces all with marked fixpoints according to the physical global coordinates.) please help...
-
I'm trying to insert a raster image by just, insert raster image. the image is a jpg. file and is in greyscale. it is a logo. the logo is in black and the background is white. when i insert and print it shows up alright but the parts that are supposed to be white print out as a light grey. Can anyone help with this?
-
How do I make one selection automatic with getkword?
jeremyearle5 posted a topic in AutoLISP, Visual LISP & DCL
I want to make the insert option happen by just pressing enter in the following code: (defun c:mak521 () (if (/= (tblsearch "block" "521") nil) (progn (beep) (initget 1 "Yes No INsert") (prompt "\n521 has already been created.") (setq x (getkword "\nInsert 521 at 0,0 or redefine it? [Yes/No] <INsert>: ")) (cond ((= x "Yes") (mak521)) ((= x "No") (exit)) ((= x "INsert") (ins521)) How can I do this? -
Need help making a routine to insert a certain set of blocks all at once at 0,0?
jeremyearle5 posted a topic in AutoLISP, Visual LISP & DCL
I use autocad 2000 at my job to create drawings for CAM. The machining paths are numbered between 521-850 (this is the block name) each time with numbers being used throughout this range, not nessecarily in order. What I want to do is get only these numbered blocks to insert all at once with one command at 0,0. Question one: Can I get a list of just the block names with autolisp? Question 2: Can I filter the block names with some sort of cond? or will I have to go about that another way? -
I am attempting to update a numerous amount of blocks in an older drawing. Doing this one at a time is time consuming. I have done some research and found a few LSP that do insert multiple blocks, BUT they seem to not redefine the block definition. Here is the code that I have that I think works well except for the redefining: (defun c:BlkImport (/ path LastDist gap space err newblk bname obj ll lr ur InsPt dist GetFolder) (vl-load-com) (defun GetFolder ( / DirPat msg) (setq msg "Open a folder and click on SAVE") (and (setq DirPat (getfiled "Browse for folder" msg " " 1)) (setq DirPat (substr DirPat 1 (- (strlen DirPat) (strlen msg)))) ) DirPat ) (defun activespace (doc) (if (or (= acmodelspace (vla-get-activespace doc)) (= :vlax-true (vla-get-mspace doc))) (vla-get-modelspace doc) (vla-get-paperspace doc) ) ) (setq gap 20) ; this is the gap between blocks (setq LastDist 0.0) ; this is the cumulative distance (if (setq Path (GetFolder)) (progn (setq space (activespace (vla-get-activeDocument (vlax-get-acad-object)))) (prompt "\n*** Working, Please wait ......\n") (foreach bname (vl-directory-files Path "*.dwg" 1) ;; OK, try & insert the Block (if (vl-catch-all-error-p (setq err (vl-catch-all-apply '(lambda () (setq newblk (vla-insertBlock space (vlax-3d-point '(0.0 0.0 0.0)) (strcat path bname) 1.0 1.0 1.0 0.0)) )))) ;; Display the error message and block/file name (prompt (strcat "\n" bname " " (vl-catch-all-error-message err))) ;; ELSE (progn ; INSERT was sucessful, move the block ;; get bounding box (if (vl-catch-all-error-p (setq err (vl-catch-all-apply 'vla-getboundingbox (list newblk 'll 'ur)))) (prompt (strcat "\nBB Error - could not move " bname "\n " (vl-catch-all-error-message err))) (progn (setq ll (vlax-safearray->list ll) ur (vlax-safearray->list ur) lr (list (car ur) (cadr ll)) dist (distance ll lr) ) ;; MOVE the block (setq ;InsPt (vla-get-insertionpoint Newblk) NewPt (polar '(0. 0. 0.) 0.0 (+ LastDist Gap (* dist 0.5))) LastDist (+ LastDist Gap dist) ) (vlax-put Newblk 'insertionpoint NewPt) ) ) ) ) ) ) ) (princ) ) (princ) (prompt "\nBlock Import Loadd, Enter BlkImport to run.") Anybody know how to change the code to redefine? Thanks!