AutoCAD Visual LISP / AutoLISP :: Move A Named Block Left 5 Inches

May 24, 2012

I'm dabbling in lisp to reduce some drafting time. I'm looking for a way to move a named block left 5 inches. The names block in this instance is "Bricks". What would be the easiest way of writing this in lisp form? I searched through the forums and I couldn't find what I was looking for. This is not after an insert command. This is a block that currently exists in the drawing template.

View 9 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Select Top Block Of Column And Get Bottom Left Bounding Box Corner

Jul 10, 2013

I have blocks forming a column, and I need to allow the user to select the top block of the column but return the bottom left corner of bounding box of the bottom block in the column. 

(DEFUN NXT-INSPNT (/ BLKLST CURENT CUROBJ IDX IPNT MCMD NENT SEL SS VENT) (PROMPT "
>> Pick the Category HEADER to add note:") (SETQss nilss (SSGET ":E:S" (LIST (CONS 0 "INSERT"))) )
(IF ss (PROGN (SETQ sel (ENTGET (SSNAME ss 0)) iPnt (CDR (ASSOC 10 sel)) )
(princ iPNT) (setvar "attreq" 0) (VL-CMDF "-INSERT" "LEG-NOTE" "S" 1 iPnt 0 PAUSE)

[Code] ....

 I'm not exactly sure where my code is failing but I get the following error.

error: AutoCAD.Application: Null extents

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Using SSGET To Select A Block To Move It

Feb 3, 2012

I'm having an issue with using the SSGET to select a block so I can move it. I'm changing the UCS to be at the center of the top view in the program(user selects center) and the block is at 0,0,0 after changing the UCS. However when I use SSGET it doesn't select it. So I used:

(setq en(car (entsel "
Select a block :")))(setq enlist(entget en))
 
and it lists the DXF Code of 10 as

(10 15.0893 13.5165 0.0)
 
How can I then select it if I don't necessarily know where the block is going to be?

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 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Copy / Move And Rotate Block(s) About Y-axis

Jul 31, 2012

I found a program which rotates selected block(s) about thier insertion point.  I modified it to rotate each of the block(s) about the y-axis.  Works great.  Now, I would like to change it so that it rotates a copy of each block about the y-axis and leaves the origial block in place.  Its kind of like the mirror command exept it is rotating the new block(s) to the other side instead of flipping them.  I want to keep all or the parameters of the block(s) the same as each original.   I am using AutoCAD 2010.  MOCORO is not recognized as a command.  The new features workshop says to use the new command AMCOPYRM, which is not recognized either.  Go figure.

(defun RotateDuplication (/ CN ENT theObjects SS)
  (vl-load-com)
  (setq SS (ssget (list (cons 0 "INSERT"))))
  (repeat (setq CN (sslength SS))
    (setq CN      (1- CN)
   ENT      (ssname SS CN)
  
[Code] ......

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Automatic Move Preset Block To A Layer

Mar 20, 2012

If there any lisp for the below sequence:-

1) select a few group of pre-set block name
2) change all these pre-set bloack name to a layer " Eye Bolt"

At moment, i have several kind of block such as example of "EB10", "TEB10","EB8","TEB8" and etc.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Delete Files Named In List

Aug 19, 2012

I have list like (C:projectspr0310.dwg  C:projectspr0315.dwg C:projectspr03drawings17.dwg)

Want these three files deleted from C:projectspr03.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Freeze Layers In Viewports On Named Pages?

Jun 24, 2013

I am in need of a LISP to freeze layers in viewports on named pages. I found the following functions to return the frozen vport, but it only returns the list of already frozen and it only works if the viewport is active; besides just listing the frozen layers isn't enough. I need to be able to supply the page/tab and a list of layers to freeze.

; by Jürg Menzi 1999(DEFUN GetFrozenLaysInVport (/ LayLst) (FOREACH memb(GetMviewInfo) (IF(= (CAR memb) 1003) (SETQ LayLst (CONS (CDR memb) LayLst)) ) ) (REVERSE LayLst))(DEFUN GetMviewInfo (/ ActVpt CurSet IDX RetVal TmpVal) (SETQIDX TActVpt (CAAR (VPORTS)) ) (IF (OR(= ActVpt 1)(= (GETVAR "TILEMODE") 1) ) (SETQ RetVal nil) (PROGN (SETQ CurSet (SSGET "X" '((0 . "VIEWPORT")))) (WHILE IDX(SETQ TmpVal (ENTGET (SSNAME CurSet 0) '("ACAD")))(IF (= (CDR (ASSOC 69 TmpVal)) ActVpt) (SETQIDX nilRetVal (CDR (ASSOC "ACAD" (CDR (ASSOC -3 TmpVal)))) ) (SETQ CurSet (SSDEL (SSNAME CurSet 0) CurSet))) ) (SETQ CurSet nil) ) ) RetVal)

Is it possible to provide the page/tab name and a list of layers as aguments to a subfunction that could either activate the viewport and freeze a list of layers, or simply freeze the layer list for the named page's/tab's corresponding vport.

Important: most of my pages/tabs contain at least two vports. The largest of the two vports is the only one I wish to change, but if the layer list is frozen on all vports (per page/tab) it will make no difference because the smaller vport only requires that layer 0 is visible.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Load LSP File Named For Windows Login

Sep 14, 2012

If my windows login name is HSIMPSON and i have created HSIMPSON.lsp in a Supported Directory, how do I load that Lisp file via the command line?

I have tried:

(load "loginname")

but that doesn't work because the 'load' command seems to want an explicit name, not a variable name.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: CANNOSCALE Value Needs To Match Existing Named Scale

Jan 18, 2012

The crux of the matter is that the CANNOSCALE value needs to match an existing named scale.  This lisp is part of a bigger lisp and I need to pass a variable into it.  Here's what I have:

(setvar "CANNOSCALE" (strcat "1" = " (rtos variable 2 0) "'"))

But I get this error when I try to run it.

; error: bad argument type: numberp: nil

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Font Of Named Attribute Throughout Drawing

Sep 25, 2012

how to change the font of a specific attribute in all my blocks in a drawing.  I am trying to change the INST attribute font to Arial but I have thousands of them through out my project.  My other attributes that I do not want to change are using the same Style as this block so I can not simply change the style.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Can Add Named View Control To Quick Access Toolbar?

Dec 8, 2011

I've made a failed attempt to add the RIBBONCONTROL Named Views to the main Quick Access Toolbar. The Customize User Interface dialogue box (CUI) seems to allow me to drag the Named Views  RIBBONCONTROL from the command list to Quick Access Toolbar 1. I don't see the "forbidden" icon and the blue insert bar shows up when I perform the drag operation.

However, I suspect there is some compatibility issue, because the command doesn't pop up when I release the mouse button at the end of the drag operation. Using command QUICKCUI and trying to drag Named Views RIBBONCONTROL directly to the Quick Access Toolbar (on screen) seems to be allowed likewise, but doesn't work also.

Using the regular View Manager Dialogue is not the kind of solution I'm looking for, because in the View Manager it takes at least twice as much mouse clicks to change to another view.

Any way to reach the desired customization? Should it be reported as a bug to Autodesk?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Possible To Make Left Mouse Click Initiate Zoom Window?

Jan 1, 2012

I still want it to have its normal behavior while in a command, but when not in a command it still enters the selection mode, which does not work, but if it would enter a zoom window command, it might be a more useful command.

View 5 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 :: 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 :: 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 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 :: 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

AutoCAD Visual LISP / AutoLISP :: Block To Annotative Block?

Dec 23, 2013

I have a dwg with 40 blocks that have a non-annotative property. I can go through 1 by 1 and change the property to annotative and redefine the block. Is it possible to automate this? I have done some google searches but have not found anything I am able to cut and paste or put together to get it to work.

Civil 3D 2012 SP4.0 Windows 7 Enterprise 64-bit
C3D 2014 SP1
Dell M6600, Core i7 @ 2.3GHz, 16 GB ram
Dell T3500 workstation, too much ram to post

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Diesel Expression - Display Area In Square Feet Not Square Inches?

Feb 16, 2010

How I can update my diesel expression to display the area in square feet not square inches. See expression below.

^C^Cattdia;0;_-insert;AREABLK;1;1;0;$M=$(getvar,AREA);attdia;1

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: VLA-MOVE A Selection Set?

Oct 3, 2011

I wrote a lisp program which creates a selection set using ssget. Then I use the bounding box commands to get the lowest point of that selection set. Now I want to move that selection set as a whole using the vla-move command. Can we vla-move a selection set?

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Move Tables In Drawings?

Jan 22, 2013

I have a lot of drawings with two tables in them, and they are all over the place.

I'm able to change the columns widths using the following

(setq PipeList (vlax-ename->vla-object (car (entsel))))
(vla-setcolumnwidth PipeList 0 0.25)
(vla-setcolumnwidth PipeList 1 0.25)
(vla-setcolumnwidth PipeList 2 2.0)
(vla-setcolumnwidth PipeList 3 1.5)
(vla-setcolumnwidth PipeList 4 1.625)
(vla-setcolumnwidth PipeList 5 1.0)
(vla-setcolumnwidth PipeList 6 1.75)

I'm wondering if I could modify the assoc 10 value to a specific point of '(8.5 10.3675 0.0).

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: VLA Move With Selection Sets

Oct 3, 2011

I wrote a lisp program which creates a selection set using ssget. Then I use the bounding box commands to get the lowest point of that selection set. Now I want to move that selection set as a whole using the vla-move command. I am having trouble doing this. Is this possible? Can we vla-move a selection set? Is there a workaround?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Copy / Move All Entities In Two Coordinates

Jul 16, 2013

I am having nearly 1000 drawings where I need to change the title block in a new format.

I am stuck up in moving all the entities  in  cordinates 15,280 (upper point) and 205,55 (lower Point) to 275,294 (upper point and correspoing lower point.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Move Selected Objects By Value Of Their X Or Y Properties

Nov 23, 2012

I need a program to move some selected text to a line something like as extend command but for text objects!

suppose that there is a horizental line (y=constant) or vertical line (x=constant) and some selected text(or other objects), I want a lisp program that move these selected text (or objects) by their "insertion point" to this line.

in other word, if the selected base line is horizental (y=constant) then property of "Y" of all selected text should change to line's "Y"; and if selected base line is vertical (x=constant) then value of "X" of all selected text should match to line's "X" value.

for example, for base vertical line (x=constant) and 3 selected text(or can be any object) result is:

text1.          |                        text1.|

  text2.        |         ===>       text2.|

    text3.      |                        text3.|

|  .text1                                 |.text1

|    .text2                ===>       |.text2

|      .text3                             |.text3

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Disable Command MOVE On Reactor?

Feb 7, 2012

I use the following code to assign a reactor to an object:

(setq marReactor (vlr-object-reactor (list (vlax-ename->vla-object oggmar)) "TEST" '( (:vlr-erased . reactor_upd) (:vlr-modified . reactor_upd) ) ))
 
"reactor_upd" is the name of the function that starts every change or delete the object.

I would like to exclude the command "MOVE", ie if I move the object, I do not want that part to the"reactor_upd" function.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Move Multiple Text To Line

May 31, 2012

I have some general knowledge in lisp coding. But I can't seem to figure this one out (even to get started). What I want to do is make a lisp that:

 - selects a line

then

 - select any amount of text (any type)

then

 - moves all the text to that selected line without rotating the text

if a line is perfectly horizontal then move the text of the y axis.

if the line is vertical then move the text of the x axis.

or there can be a prompt asking the user to chose the angle or axis in which the text will move (say if they want to move the text to a slanted line, you can choose to move the text on an angle, while keeping the same format and not rotating the text, or you can ask the user if they want to move it only vertically or horizontally)

I would really like the code to integrate into my autocad.  

See pictures

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Move The Selected Object Using ObjectDBX

Aug 7, 2013

Using Nentsel function, I can get info on a object that is nested with an Xref. Is there a way to move the selected object using ObjectDBX?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selection Set By Block Name?

Mar 2, 2012

I am trying to select all blocks of a certian name. I am using the following:

(setq ss1bk (ssget "_X" (list (cons 2 blkname))))

My issue is that this will not select any dynamic or attribute blocks that are not at the default insert state. 

how to select all of a block by name including reguardless of current state?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Odd Insert Block

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

AutoCAD Visual LISP / AutoLISP :: Block Name To VLA-object?

Feb 21, 2013

I need to get VLA-Object from block name.

here there is a code to get block name from VLA-Object:

(vlax-get-property obj (if (vlax-property-available-p obj 'EffectiveName) 'EffectiveName 'Name) )

 but I need the inverse of this code exactly:

blockname(as a string)==>VLA-object

(defun GetVLA_BName (BName).......

so, how can I do it?

View 9 Replies View Related







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