AutoCAD Visual LISP / AutoLISP :: Place Circle On Selected Blocks Insert Point?
Mar 11, 2013
You have a dwg with multiple sets of different blocks and a circle you want to place on the insert point of each set blocks.
You select the circle then select one of the blocks in the set and the circle is placed on the insert point of each of the blocks in that set. It would save time from doing it manually and save on mistakes.
View 9 Replies
ADVERTISEMENT
Aug 22, 2011
I found this routine but It doesn't work really good (see attachment):
1. We can select block instead of typing the name of it (or simply add this option)
2. That the undo command undo the whole lsp routine instead of undoing all single insertion.
3. That we can Hit the escape key at any point in the routine and it stops the routine correctly instead of writing "too many argu" maybe by undoing the insertion or by stopping the routine correctly at this point.
4. I just found that it does not paste the block directly on the points...? Finally this lsp didn't work at all !
I would like to have a lsp that do SIMPLY this:
1 : Ask wich "points" you want to convert (You know these points that you can change the appearrance in the menu format point style, thats what I mean by "points"). And By the way it would be cool if I could choose to convert the points or to paste my block on those without converting them but it is not that important.
2. Select block in the block listing of insert block popup window and paste it by his default insertion point to all the selected points.
Infos: New blocks on current layer.
View 9 Replies
View Related
Sep 26, 2012
trying to insert point instead of block.
(setq blok (entget (car (entsel))))
(setq point (cdr (assoc 10 blok)))
(setq XX (rtos (car point) 2 20)) ;; x koordinata bloka
(setq YY (rtos (cadr point) 2 20)) ;; y koordinata bloka
(setq ZZ (rtos (caddr point) 2 20)) ;; z koordinata bloka
(command "point" xx,yy,zz) is not working
!xx="5582453.414999999" but when i (atoi xx) i get 5582453 no dedimals...
how to create valid insertation point from xx, yy and zz?
View 6 Replies
View Related
Feb 28, 2011
(defun CELBLKS ( / e blk ss blkl)
(setq blkl "" ss (ssadd))
(while (setq e (entsel "
[Code]....
i have this lsp, it works great but how can modify it if i want select with a window.? exemple: if i have 3 differentes blocks, i want to select them with windows and the lisp select all blocks that are identical of those 3.?
View 9 Replies
View Related
Sep 2, 2013
how can you get the last point you picked on a Circle because I was going to run the TTR and use the tanget command and have it exit and I need to get the point I pick on the circle
View 7 Replies
View Related
Apr 19, 2013
I need a routine that inserts a point at the insert point or block named "Insert_Point" at every block in the file. The routine could use the current layer, which would be set prior to starting the routine. If it could request the user for the PDMode value and PDSize that would be great too. This will assist me in creating block libraries.
View 9 Replies
View Related
Sep 19, 2012
I am trying to insert a norht block oriented on two selected points with the following
(defun c:North ( / ss )
;Orientate North Symbol
(setq oldos (getvar "osmode"))
(setq blk (vlax-ename->vla-object (car (entsel "
[Code] .......
I am not sure how to (a) erase the selected north block, then (b) make the insert north block in its place bit work.
View 6 Replies
View Related
Dec 24, 2013
I currently insert certain dynamic block into drawings with a short function that first inserts the specified dynamic block and then immediately changes the visibility state to one specified as an argument to the function.
I'm wondering if it is possible / better / faster to somehow insert the dynamic block with the decided visibility state simultaneously. I've been amazed by many capabilities of VL so I wouldn't at be surprised if this can be done. (the dynamic blocks I'm inserting could have many multiples in the drawing but I need this method to only affect the one being inserted at the time the function is called. I currently use entlast to decide which one is being inserted.)
View 6 Replies
View Related
Nov 30, 2012
i have found the following lisp in a previous thread: (shows XY coordinates of the selected blocks)
(defun C:MyFunc (/ ss Index Ename Lst)
(while (or (not ss) (= 0 (sslength ss))) (setq ss (ssget '((0 .
"INSERT")))))
(if ss
[Code]....
I want this information to be added to the blocks as hidden attributes so that i can extract them by attout. The work to be done is : attout to excel, autofill an attribute (numbering) then attin.
but my problem is that i cant think of a way to number those blocks IN ORDER (ie top to bottom or left to right) unless by sorting them in excel first by their x or y coordinates
View 9 Replies
View Related
Jul 17, 2013
I having real difficulty finding a lisp that will find and replace blocks. There are plenty out there and AutoCAD 2013 and lower has a Find and Replace Blocks. However, the frustrating catch is I can seem to find a routine that will allow me to replace only those blocks that I select with a selection set of my choosing. The built in function replaces all of them and will not let you exclude some. We have PID drawings that we want to replace valves on, but not all valves. We don't want to rename. We don't need to BEDIT the existing block.
1) Pick group of blocks
2) specify a new block that will replace all instances of old block
3) replace inserted block with different block. Leaving others alone.
I'm thinking this should be easy, but my search has failed. The blocks in question are not dynamic or attributed either.
View 3 Replies
View Related
Sep 14, 2013
I found this LISP code that can insert a block at coordinates from an ASCII.
(defun c:universal( / file f a osmode);PointsToBlocks(while (not file)(setq file (getfiled "Input file" "coords" "txt" 4)))(setq f (open file "r")osmode (getvar "OSMODE"))(setvar "OSMODE" 0)(while (setq a (read-line f))(command "._insert" "block1" a 1 1 0))(setvar "OSMODE" osmode)(princ)
What I want to be able to do is insert blocks from an ASCII and also set the x-, y-, and z-scales.
For example, I have these lines in ASCII, the data points refer to X position, Y position, Z position, X scale, Y scale, and Z scale.
30.593589,21.274607,26.235255,0.172826,0.766324,0.066442
30.710182,21.379792,27.054248,0.130816,0.700035,0.043114
View 1 Replies
View Related
May 8, 2013
I have a lisp routine that I would like to add to. Right now when running the macro the user is not prompted to "Pick Point On Line" in this example
(command "insert" blk "s" var1 pause pause))
I have added the line
(setq pt1 (entsel "Pick Point On Line "))
(command "insert" blk pt1 "s" var1 pause pause))
but the command doesn't seem to like my PT1 value
BLK and VAR1 are set in another lisp routine.
View 9 Replies
View Related
Oct 3, 2012
How to create a lisp to automatically export attributes from selected blocks to defined txt file without having to everytime confirm the file name, location and if the file shall be replaced?
Meaning is that I often export attributes to txt file for further use. It is always the same file (I just overwrite it always).
The way I do it now is selecting blocks, using ATTOUT command, then going to the desktop, selecting ATT.txt file and confirming that it is to be replaced.
Is there a way to make lisp or script that will just do all it in at once?
I found on forum such a lisp as below, but it exports all ablocks on drawing and it exports to txt file which is located in same place as drawing and with same name as drawing. Tried to modify it but without success:
(defun cut-att ()
(load "attout")
(setq fna (strcat (getvar "dwgprefix")
(acet-filename-path-remove (acet-filename-ext-remove (getvar "dwgname")))
".txt"
))
(setq ss (ssget "X" '((0 . "INSERT") (66 . 1))))
(bns_attout fna ss)
)
Same question for ATTIN - I use attin and always same file name from same location - how to automate it with one command?
View 9 Replies
View Related
Apr 9, 2012
For a program i am working for i have to extract the base point of a dynamic block.
This can be done perfectly by this function:
(cdr (assoc 10 (entget (car (entsel)))))
But i want the entity selected based on a previous slected point. So for example when i selected pt1 (which is a point at the border of the dynamic block) i want to be able to extract the base point on the block whit this point.
View 8 Replies
View Related
Aug 17, 2012
i found this valuable script Lisp routine to insert blocks at point locations and want to modify it but i do not know much about lisp ...
what i want is :
1) script start and asks for a Block Name (in this case QPP1, QPP2, QS, QE, ect)
2) the user picks existing text
3) the script reads the value existing on this text an put it in a variable
4) then erases the pre picked text
5) inserts the block chosen
6) changes block value to number value pre-read
since it do almost all steps except for step 3 and 6
View 4 Replies
View Related
Apr 18, 2013
I am learning autolips and i found a problem that i can´t solved.
(vl-load-com)(defun c:pmb ( / ss ent pt )(prompt "
selec block : ")(setq ss (ssget '((0 . "INSERT")))) (setq ent (ssname ss 0)), (setq pt (cdr (assoc 10 (entget ent)))) (command "point" pt))
wich this code you select one block and insert one point at insert point´s block.
which this other code yo select all block and insert all point.... but in one block
(vl-load-com) (defun c:pmb11 ( / sele cod bloque nbloque lista pt ) (prompt "
block: ") (setq sele (ssget ( List'(0 . "INSERT"))) Cod 0 )cod (1+ cod) (repeat (sslength sele) (setq bloque (ssname sele cod)) (setq pt (cdr (assoc 10 ( entget bloque)))) (command "punto" pt) );repeat )
View 4 Replies
View Related
Jan 24, 2012
I have a project in 3D that I would like to export to Stadd. This requires lines rather than blocks. Is is possible to convert the blocks in the attached dwg file to to lines that are centered on those blocks?
View 9 Replies
View Related
Nov 13, 2012
I have a lisp file that reads in a point list from a text file and creates a number with a circle around it for every point, then a line from one circle to the next in line with the center point of each circle. Is there a simple way of making the lines "go behind the circles". The portion of code that creates the circles, lines and text is as follows and a cutout screen dump of what it looks like is below.
(setq amount 0)
(foreach item lines
;;; ;;
;;; Create the text ;;
;;; ;;
(setq x (+ (atof (nth 2 item)) (car pt_origin)))
(setq y (+ (atof (nth 3 item)) (cadr pt_origin)))
[Code]....
IV 2010
View 9 Replies
View Related
Dec 12, 2002
I was looking for a post on the subject of line and circle intersections and found one that Bill Z had posted. I decided to incorperate one of the replies into my own code. In particular Luis Esquivel's code. With some minor modifications I was able to add the onseg argument that extends intersection points for the line to the circle. I also modified it to return only one point or two points depending on the line and circle supplied and the onseg argument. It seems to work great.
; test function
(defun c:go ( / )
(ed_init)
(while
(or
(not (setq ent (entsel "
[code].....
View 9 Replies
View Related
Sep 26, 2013
I have a routine that counts dynamic blocks by visibility state and stores that information then prompts for scale and color and stores that information. Then a legend begins to build from the data and a collection of blocks to reflect the dynamic blocks and their visibility state. Everything works great on all of the machines around the office except on one. When the legend begins building, the one user is getting the DDATTE dialog instead of allowing the values to populate as expected. So, I had him change ATTREQ to 0 an run again. No deal, the same thing happens again and again. And; it only occurs on the one machine.
View 5 Replies
View Related
Apr 9, 2012
is there a way to code inserting all pdfs in a multi-page pdf at once?
another one would be, say, you have several pdfs in your dwg that represent different aspects of the same space so you select them (they are on top of each other) and it puts them into a dynamic block automatically in different visualization states (maybe labeled 01,02,03 etc.) and you make one of the sheets visible with a drop down button.
i might be able to figure out the later if there is a way to do the former.
View 2 Replies
View Related
May 10, 2012
I can't seem to find the SYSVAR that controls insert to 0,0,0 instead of pick on screen..
Quad Core 2.3GHz Intel, 64-Bit, Win 7
16GB Ram, 2GB Graphics Card
256GB SSD
View 2 Replies
View Related
Nov 11, 2013
This is in regards to the LIP command in Toolpac. The layer properties for a selected nested object (LIP) used to default to nested. Now you have to select nested from the list of options. Why they would change LIP. My whole company had gotten so used to it.
View 4 Replies
View Related
Jul 20, 2011
I want to create a routine that will place selected objects on a the corresponding demo layer. Here is the outline:
enter command
select object
extract layer name of object (i.e. "CS CURB")
if demo layer exists (i.e. "CS CURB CD")
>put object on demo layer
>else create demo layer, and place object on layer
I could select multiple objects on different layers.is this possible with lisp? any good starting point for lisp programing?
View 9 Replies
View Related
May 17, 2013
How do you detect the intersection of a line and circle or arc.
View 1 Replies
View Related
Jul 23, 2004
Routine that will draw a insulation hatch around a circle?
View 9 Replies
View Related
Oct 3, 2013
I need a lisp which is i can draw a line or pline with circle in every 30 meters ( circle diameter and total line or pline length will be optional )
View 6 Replies
View Related
Nov 14, 2012
I need a LISP program that prompts: "select text(s)" then I select for example 100 text in open drawing file.
after that this program creat a file (LIST.CSV) and write each selected text in line by line of this file:
result text file (LIST.CSV ) should be:
Text1
Text2
Text3
...
...
Text99
Text100
ofcourse Text1 is the content of a text object.
View 9 Replies
View Related
Jan 1, 2014
I need a LISP that create a new layer and ask me for the name and the other properties (color,lw,lt..).
ask me if I want move the selected object for the new layer (yes is the default value)
View 9 Replies
View Related
Oct 18, 2012
Any way to detect of there are objects currently selected using Autolisp, visual lisp or even VBA. I would like to be able to do something using that as a conditional, so that (assuming the hypothetical variable isSelected is an on/off indicator of whether or not something is selected) I can code something like this:
(if (isSelected) (...))
View 4 Replies
View Related
Apr 22, 2013
I am trying to insert one or another block into a drawing, and i need to do this 8 times per drawing.
(defun C:detector (/ filename gas pressure)
(repeat 8 (initget 1 "Gas Pressure")
(setq filename (getkword "
Enter Detector Type [Gas/Pressure]: "))
(if (= filename "gas") (command "-insert" "*T:\acad\schematic_circuits\suny\sunygasdetectornew.dwg" pause "" "")
(or (if (= filename "pressure")
(command "-insert" "*T:\acad\schematic_circuits\suny\sunypressuretransmitternew.dwg" pause "" ""))
) ;;end or
) ;;end if
) ;;end repeat
)
View 4 Replies
View Related