AutoCAD Visual LISP / AutoLISP :: Changing Insertion Point Of A Block?

Feb 6, 2011

I have insert blocks in my dwg. It is the circle. While creating the block, i was just pick the point into the circle not exactly at the centre.

Now i want change the insertion point of the block at centre of the circle without moving the objects from the dwg.

Beacuse i had use block editor to change the insertion point. But after changing, all blocks were moved from the original position.

View 4 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Find A Block And Get Its Insertion Point?

Jan 27, 2012

How can I find a block with a specific name and get what the coordinates are? What we have is our Bill of Material is attributed blocks. I am attempting to change the first one. Well all of the lines that list the parts are seperate blocks with the same name. Now the Top Line of the Bill of Material is a different named block. If I can find the coordinates of this block I can then select the first line to do what I need to.

If needed: AutoCAD 2013 User using Visual LISP for editing LISP and DCL files Also I have AutoCAD 2011 currently still available for us, but we are using AutoCAD 2013 for 99.9% of AutoCAD use

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Multileader Block Insertion Point?

Oct 21, 2013

My multileader style uses a block as a content. How can I find world coordinates of insertion point of block entity within multileaders?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Rounding Up Block Coordinates (insertion Point)

Sep 2, 2013

We have several AutoCAD drawings with hundreds of block references inserted with imprecise coordinates. Now we need to dimension all elements and need to correct these positions.

I am searching for a routine to round these positions up or down towards a 5mm precision so I don't have to manually move every single block element.

Is there any way to automate the task or do you know any workaround (like inserting the elements into a drawing with poorer unit precision settings)?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Block Insertion Point Is Within A Closed Polyline

Oct 11, 2011

I've have code to test if the insertion point is within a closed polygon. But prior to testing the insertion point I use ssget to trim the selection set initially..

(ssget "CW" Pnt_List (list (cons 0 "INSERT")(cons 2 BlockName)))

this requires that the whole Crossing Polygon is visible, so I do a zoom first. This requires time. Is there a way I can do this that does not require the zoom?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Block Insertion Routine Based On Block File Name

Apr 5, 2013

Create a routine that looks for a block based on a portion of that block name, using a specified path or search path. 

For example, block to search for is BLOCKABC123, so if someone inputs ABC or 123 as a block name, it will locate that block within that folder and inserts it into the drawing at a user specified location.

Ideally, if there is a check in that if it finds more than one match, then perhaps it flags or prompts you to choose 1, 2, or 3 option which block to use.  But I can live without this special function if it requires too much time to code.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Insertion Point Of Text

Jan 10, 2008

How do I change the insertion point of a text using "vla-put" ? I've tried using :

(vla-put-InsertionPoint en a)) with a = (4455.94 428.576 0.0)

and I get the following error:

lisp value has no coercion to VARIANT with this type: (4455.94 428.576 0.0)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Using Insertion Point To Select Line Rather Than Using Entsel

Aug 12, 2013

We have been modifying a trim-around-block routine to have as few clicks as possible and though it feels like we'd be able to have the line to be broken auto-selected based off of the insertionpoint that was set as a variable.

;(setq pnt1 (getvar "lastpoint")
;      sst1 (osnap pnt1 "nea")
;end setq

;(setq ss (ssget '((0 . "LWPOLYLINE")))) ; limited to Polylines
; (while (> (sslength ss) 0) ; as long as there's anything in [or remaining in] the selection set))
; (setq ent (ssname ss 0)
; paramcount 1
; ) ; first entity in [or remaining in] the selection set paramcount 1); end setq
 
are about the closest snippets of code that we've managed to find but neither of these are working.

How we can force the program to break the line without the user having to select the line (because they will have already selected the insertpoint, and using osnap nearest would find the line that requires breaking)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: FAILSAFE Basic Block Insertion?

May 20, 2013

I need a function that accepts a block name as an argument and will insert the named block without fail no matter if the block was made to scale uniformly or not.

How can I determine if the block should be inserted like:

(command "-INSERT" blkn "0,0" 1 0)

or:

(command "-INSERT" blkn "0,0" 1 1 0)

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Block Layer After Insertion

Mar 7, 2013

wondering if is possible to have a lisp routine to:After use the INSERT command, the routine will automatically change the layer of the inserted block to a specific layer according of its name.

i.e.

Step 1 : I will insert a block named Block A using the normal autocad INSERT command (I do not want to insert the block without the Insert window dialog box)

Step 2 : After the insertion, the routine will select the last insertion (or the last object, or any other best way to select this block and will take it's name)

Step 3 : The routine has a list that says:

(If the last insertion (or object) is named Block A, put it in the layer Layer A with color Bylayer and linetype Bylayer)             

(If the last insertion (or object) is named Block B, put it in the layer Layer B with color Bylayer and linetype Bylayer)

and so on... I can make the approprieated list by myself folowing my standards.

I think it will be nice to avoid an error if the block is not in the list. So:

(If the last insertion (or object) name is not in the list, do nothing)

To finish, it will be nice to create the layer if it does not exist. Also, Unlock, Thaw and Turn on the layer if it's Locked, Frozen or Off.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Zoom Layout (Entities Or Insertion Point Extents)

Oct 12, 2012

I have a drawing with various layouts that when I do a Zoom Extents the drawings is reduced to the size of a point.

I have done all the usual, ie: look for extra entities that are "out in space" so to speak and there are none.

I wonder if I have a block or image which may have an insertion point "out in space" and if this may be the issue.

Is there some way to Select all entities or Blocks (insertion point) that may exist outside a particular area ie: drawing limits.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Editing Multi Leader Text Insertion Point

Nov 16, 2012

Is there a way to modify the text insertion point of multileaders using lisp? We have a problem with some of our multileaders getting a landing distance set to a negative value.  My lisp routine will correct these to a default value, but then the text jumps a bit.  If I could get the insertion point prior to changing the landing distance then I could restore that point after changing the landing distance.
 
;;-------------------------------------------------------------------------------------------------(defun c:zld (/ e th dogleg doglegllength sf ss c mlss mlcount) (setqss (ssget (ssget "X" (list (cons 0 "MULTILEADER"))))DWATxtHgt (getvar "userr1")sf 1dogleg (/ 3 32.0)th (if dwatxthgt dwatxthgt dogleg)c 0mlcount 0mlss (ssadd)) (IF ss (while (< c (sslength ss)) (setq e (vlax-ename->vla-object (ssname ss c)) c (1+ c) ) (= (vla-get-ObjectName e) "AcDbMLeader") (progn;;change the dogleglength if

[code].......

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Point At List Block And Dynamic Block

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

AutoCAD Visual LISP / AutoLISP :: Inserting Block On A Point Of Arc?

May 19, 2012

know a lisp routine that would insert a block @ a specific point on an arc? For instance if I have an arc that has a radius of 20'-0" & I want to insert a block at a set distance from the end of the arc.i could probably use the divide or measure command but I was hoping I could do it with lisp. I would also like to be able to move the object along the path of the arc at a specific distance.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Point At Every Block?

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

AutoCAD Visual LISP / AutoLISP :: Placing A Block At Pre-calculated Point

Feb 13, 2013

I would like to create a lisp that places a block at a pre-calculated point. I've created a lisp that fetches me a block to place into my drawing. The only thing is

I have to point out the place i want it to go. I want it to got into the corner by it self. I would like to create a lisp that calculates, by the retrieved variable of the layout / paperspace, minus 10

from the bottom right corner. minus 10 from the bottom up and from the right edge to the left.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Text In Attributed Block

Dec 21, 2012

I am trying to speed up some basic drafting of text revisions. In the P (plumbing) we call out the fixture units for a water pipe, along with the fixture units, the pipe size changes.
 
Is there any way to add numbers in an attributed block? (I have a lisp that works on text & mtext, but not attributes)

1.1. Example: Like if you have a block with two attributed text fields, the 1st field {x} is a number (fixture unit), and the 2nd field {y} is a number (pipe size).  I would want it to only add the 1st text fields. [If possible then change the 2nd text field according to a changeable chart. (see #2)]

1.1.1.   This is how the block looks like: x (y")
1.1.1.1.   x could be any number from 0.5 – 10,000 (only using 1 decimal place, and only as needed)
1.1.1.2.   y could be any number from the following list: ½, ¾, 1, 1¼, 1½, 2, 2½, 3, 3½, 4, 5, 6
 
Is there a way like in excel that you can set up a formula that will give a numerical result depending on other input? Like pipe size that change depending on the number of fixtures. There would need to be two different formula, one for hot and one for cold values (The value would be set at the beginning of the job; typically these values would not change later in the job). This could be separate text or if possible using the attributed block as described in #1.

2.1.    Example: Like if you have a block with two attributed text fields, the 1st field {x} is a number (fixture unit), and the 2nd field {y} is a number (pipe size).  I would want it to change the 2nd text fields according to the value in the 1st text field. If the value in {x} is 0.5 – 1.0, it would result in ½; 1.5 – 7.0 = ¾; 7.5 - 17 = 1; 17.5 – 36 = 1¼; ect.

2.2.    In excel it would be =IF(x)<1,"1/2",IF(x)<7,"3/4”,IF(x)<17,"1",…{all #’s in between} …IF(x)>5000,"6")))))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: One Button Changing Text Base Point To Be Middle Center

Aug 23, 2011

how to make a toolbar button so that when i click it and select a few single text, it will automatically change the text base point to be at "MIDDLE CENTER"....

At the moment, i use to create a button with macro of  " ^C^C_text;j;mc "....But the problem is whenever i use this button, i still need to type "MC" at the command prompt.. How to make it so that after i click the button, all i need to to is just select the text..

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Find If Point Inside Polygon / Block's Area

Sep 20, 2011

How would I go about this.  if a two blocks or polygons are overlapping area? 

A good method or the algebraic formula for a function to tell me if a point is inside a polygon or block's area? 

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Make Block Which Is Visible To Snap Only On Special Point

Dec 27, 2011

I want to make a block which is visible to snap only on a special point, say pivot point.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Block With Pick Point On Line Prompt?

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

AutoCAD Visual LISP / AutoLISP :: Select Dynamic Block Based On Previous Selected Point

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

AutoCAD Visual LISP / AutoLISP :: Insert Point At Block Insert Point

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

AutoCAD Visual LISP / AutoLISP :: Change All Block Element To Layer 0 Without Changing Color / Linetype

Sep 3, 2013

I have too many blocks with specific layers inside.

develope lisp can change all to layer 0 but keep color and linetype as it is.

I will use this as a part of script to change multiple block.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Attribute Height Is Changing Each Time Routine Is Run With An Annotative Block

Apr 30, 2012

I only do programming when absolutely needed so it usually only happens every couple years. I wrote this routine to count nested blocks inside of dynamic blocks to count parking spaces. The routine worked fine but was relying on the ltscale to scale a block containing an attribute for the total number of spaces. I want to update the routine to use an annotative block so the scale doesn't have to be set. I changed my block containing the attribute but now when I run my routine, the attribute height gets changed each time the routine is run. The text just gets larger and larger. Here is the portion of the routine where the attribute info is gathered and updated with the new value for that attribute. If you need the entire routine, I can post it with a slight modification so it will work outside our network.

(defun updateattrib ()
(setq CNT 0) ; sets count to 0
(while (< CNT (sslength ss)) ; starts loop while CNT is less than the number of objects in the group

[Code].....

I am running this in Civil 3D 2010 but will want it to work in 2013 so if the solution will only work in 2013, that is fine with me.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Basepoint During Insertion Of Blocks

Jan 14, 2013

would like to set a base point during insertion of one block.When not insert by AutoLISP, just type "b" to be able to change the base point.

But when I'm using an AutoLISP that inserts a block, it does not work, it interrupts the sequence of routine.

Lisp:
 
(defun c:carrobox()(setq #clayer (getvar "clayer")) (if (= unidades nil)(setq unidades "cm")).....

View 3 Replies View Related

AutoCAD Dynamic Blocks :: Insertion Point Of Attribute Changing Within Dynamic Block

Nov 21, 2011

I wish to create a dynamic block containing some attributes. These attributes are inside rectangles that can't be modified in length using linear parameters ; but the attribute has to be always in the middle of the rectangle. So, I draw a line inside the rectangle (in a hidden layer) and insert the attribute with center justification (not sure for the translation) that I place in the middle of this line ; then I put a coincidence constraint (not sure for the translation, but it's the first one) linking the middle of the line with the middle of the attribute.

But here's the problem : when stretching my rectangle, the insertion point of the attribute suddenly changes from "center" to "bottom left".

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Removing Nested Block From Main Block?

Oct 3, 2013

I get an AutoCAD drawing from my conveyor manufacturer who have buried a block (tagname) in all of their conveyor blocks.

The only way to remove them is to manually use BEDIT and erase the tagname block.

Is there a way through Autolisp to search all blocks in a drawings and if the tagname block is part of the definition of the conveyor block, erase the tagname block or redefine the conveyor block without the tagname block.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Retrieving Block Name Of Anonymous Block

Mar 8, 2013

When dynamic blocks are inserted they're assigned an anonymous block name.  I'd like to be able to retrieve the name of the parent block after selecting the block on screen using AutoLisp.

Need a bit of code that handles this?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Match Multiple Attribute Values From One Block To Another Block

Feb 12, 2012

I need to match few attribute values from one block to different block. I download a lisp file called; ca.lsp which can match the single attribute value. I modified it for more than one attribute value matching. It is ok but still wish to overcome two issues for batch prcess

1. picking up the blocks by selection

2. click the alternative block numbers of times to match the numbers of attribute values I needed.

How to modify this lisp I can run it by block name selections instead of picking selection which enable me to run batch process for numbers of drawing? That will be good...

Lisp & Demo file attached (Match attribute value, A, B & C to Attribute 1, 2 & 3).

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert A Block / Explode And Rename Nested Block With Suffix

Nov 30, 2012

I have a block that i want to insert several times and revised each one to be different to do this i would have to insert it and rename the blocks that come in and then reinsert i would like to insert and have a lisp explode the main block and rename the other 2 blocks with a suffix at the end depending on how many times its in the drawing... can this even be done? My original block name that will be first inserted is "BENT PULLEY NOTES" it needs to explode after i drop it in and then there are 2 blocks within that called "Bent Pulley" and "Bent Pulley DYN" that i was hoping to keep the names but add a number at the end depending on how many are in the drawing already...

here is a lisp that i have found... it would work if i didn't have nested blocks and only wanted the one block to be insert and not explode...

(defun c:Test (/ e i name Bname )
(setq e nil)
(command "_.-insert" "Drawing1.dwg" pause "" "" "")
(if (setq e (entlast))

[Code] .......

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved