AutoCAD 2010 :: Lisp Automatically Loads On New DWG?
Mar 12, 2012
Is it possible to assign a bunch of 'Lisp' programs to a template, so when I open autocad with my normal template, I also have the 'Lisp' options?If not, is it possible to load a single 'Lisp' program to load all the rest?
I am creating seed files for contractors and clients to use. I have created the object data table(s) in AutoCAD Maps beforehand to be able to view/edit in AutoCAD Civil/Civil 3D 2010.
Is there a setting that automatically attaches this data to any object (line, circle, block, etc) drawn in a sheet. I am hoping to skip the step of manually entering "adeattachdata" and then selecting the objects that the object data is to appear. I realize that each sheet would only have one object data table.
For some reason I cant get my lisp files to automatically load. im doing the same thing i did in other versions, but i have to constantly tell them to load when i want to use one.
I have them in the search path, i have them set to load with every drawing in options, what am i missing?
I first installed 2012, then I realized that my class will be using 2011. I downloaded 2011, and kept my 2012, and it didn't seem like there would be any issues. So I open my 2011 and it keeps crashing before it loads completely. There are no error messages or anything ...2012 works just fine. I tried doing a repair, and a reinstall.
I'm trying to make an autolisp that "flips" a third party variable. No luck, command line won't recognize after it loads. I've made similar variable flips that work ??
but I have more than 150 dwg file and I should open all of dwgs one by one and setting ON/OFF for STAMP layer for every drawing and it takes so much time!
I just want to select files and LISP program set the STAMP layer to ON or OFF value.
I want to find a Lisp routine for building rooms (bedroom, bath, kitchen etc). example: I want to build a bedroom and every bedroom has the following blocks: smoke detector, door, window, bed, night stand, closet. Is there a way to run a lisp routine that would just ask me for basepoints and rotation angles of all those blocks? Basically it would automate building a bedroom by inserting all the blocks for me and just prompting me for basepoints + rotation angles.
Would a macro be better suited for this? I want to do one for every room - kitchen, bath, bedroom, living, dinning etc. I already have a nice collection of blocks.
I am looking for a lisp that will rename all the layouts automatically. I tried the Layoutlist function but the output is not in order. Is there anyway that i can get all the layouts in a drawing from left to right order. for eg. i have layouts from layout1, layout 2........layout10). The layoutlist returns as layout1,layout10 etc...instead of layout 1 layout 2.
I am looking for a lisp routine which will allow me to mirror an object that I pick automatically. I don't want to have to pick the two points to set the mirror line. I just want the point I pick on of the object I select to be the point of the mirror. If that can't happen, I was wondering if the object could mirror at its insertion point (like if it were a block or a text.
How I can modify this code to create a block, ask for a new name for the block, then add the attributes listed inside the code below to the new created block. The lisp does a wonderful job - however, it only works if you already have a block created. We are in the process of drawing components and making blocks one by one, so it makes sense to add the attributes automatically when the block is created. We currently have over 500 components to create as a block and set the attributes to each one by one.
Also I would like to know, If Fields can be used inside the lisp routine. That way we can always have access to the attributes from outside the block and change values for all the blocks at once.
(defun c:addattribs ( / blk def ) (while (not (or (= "" (setq blk (getstring t " Name of block to update: "))) (tblsearch "BLOCK" blk) ) ) (princ (strcat " Block "" blk "" not found.")) ) (if (/= "" blk) (progn (setq def (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) blk)) (vla-addattribute def (getvar 'textsize) acattributemodelockposition "New Attribute 1" (vlax-3D-point 0 0) "NEW_TAG1" "New Value 1" ) (vla-addattribute def (getvar 'textsize) acattributemodelockposition "New Attribute 2" (vlax-3D-point 0 (- (* 1.5 (getvar 'textsize)))) "NEW_TAG2" "New Value 2" ) (command "_.attsync" "_N" blk) ) ) (princ))(vl-load-com) (princ)
I have an autocad file with a simple rectangle in it.
The goal is to offset this rectangle 1" to the inside of the original rectangle, then delete the original rectange.
How could I go about this in autolisp??
I know I could use basic commands to bring up the offset functions, but i'm not too sure how i could write autolisp to offset in the correct direction, and the correctly delete the larger rectangle without deleting the smaller one as well.
Maybe put them on different layers? How I could achieve this?
We are working together whit another firm and we would like to share our tool pallets and lisp routines. The pallets and lisp files we would like to share are quite large so we would like to simply send them a USB stick whit all the files and a title "executable" program that automatically puts them on the right place and changes the appropriate information.
I am working on a lisp routine that automatically inserts a parameter in a block and then ads a stretch command to it. But the problem is that for the stretch command u need to select the drawn parameter. So my plan was to get the name of this parameter (car (entsel)) and feet it to my lisp program. But when i do that it doesn't work because autocad demands a parameter.
How to change the Scale Uniformly property in dynamic blocks accross hundreds of drawings using either/or scripts, lisp, vba or anything else that might do the job.
I just need to open the drawing and select the block (one block per drawing) then edit the scale uniformly property within the block, save then close the drawing and move onto the next drawing.
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:
I have multiple of the same drawings. The drawing will stay the same but the device names will be different for each drawing. Is there a way to have a excel lookup table for each device and each drawing can reference to ?
My colleague made some drawings using AutoCAD 2011. Somehow the sheet status in Sheet Set Manager says all the drawings are locked for editing - it was unintentional. The drawings can be fully viewed only from the computer, which created the drawings. In other computers, we can only see the text. The model view and the bottom of the drawing which contains drawing number and other info do not show.
We need to deliver our drawings to the customer so they can see the coordinates in the maps/drawings.
How could we change the status or unlock it so the customer can view the entire drawings? If possible, we still want the drawings unable to be edited.
In our computer, we have AutoDesk Vault - did it somehow kicked in automatically?
Is there a way to set the “lineweight” to be Color-based automatically?
I’m wondering if there is a way to set the lineweight to be color-based such that all the objects have the same color will take the same lineweight automatically.
Sure, we can control such behavior through the “bylayer” feature but I’m not sure if this very particular behavior might exist in the AutoCAD; color-based lineweigth!
My company has many clients that each have different pen table, text styles, directories, templates etc. What we would like to do is create a toolbar/ribbon that does the following but not limited too:
1) Change the CUI file to the current client
2) repath AutoCAD so that the program will find templates, textstyles, pen tables, etc unique to that client (we keep each client setup files like this in separate directories)
I am sure there are other variables, pathes, toolbars etc we will need to change as well. What I would like is a toolbar button or ribbon button to do this seamlessly so that each user can quickly and efficiently change from one client to another.
how I can accomplish this or variables that would need to be changed in a LISP routine etc
Can autocad automatically create a sequentially numbered array. I do concert seating and am looking to create an array of seats and have them be numbered automatically as I create the array.
I have this table that's reading my table style. All cell formatting is set to General and middle center justification.
When I type in a number the formatting automatically changes from General to Whole Number and upper right justification. When I type in letters everything it fine.
Why using numbers changes the formatting? In the textstyle I have changed the cell formatting to Text but that doesn't work. If I select the table, right click and choose Remove Overrides it moves the numbers to Middle Center as set in the style.
I've created a table (a door schedule for example).The data cell type properties is "general". The door # is "001". When I type this in, it switches to just "1" and the type is swiched to "whole number." Same for another cell with a number in it, it switches the cell type on me and I don't want what it switches to. Every time I try to switch it back it doesn't do anything.
How do I stop it from automatically switching, or at very least let me override?
How can I automatically get point coordinates and show it in drawing. For example I have 100 points and I need to write x and y coordinates right next to the point. (not in table or somewhere else).I guess I need a plugin or smth?
We’re working in AutoCAD 2010 but need to save as 2007 DWG. AutoCAD is set in Options to save to 2007 format, and all files - host and reference - are or should be in that format.
Something is triggering an automatic save of the xrefs. The xrefs are not being edited, in-place or otherwise, but every so often I get a balloon message saying the xref has changed and I need to update it. So I update it, and when I check the file format, I find it’s been saved in 2010 DWG.
Other people on the project are also having this problem. Engineers on this project are using 2009 and keep coming to us and asking where the xrefs are.
This is AutoCAD 2010, "English Version 3" running in XP2 SP3.
If my SNAP is turned OFF it automatically turns itself ON when i draw some linework. It keeps doing this in certain 2D only cad files. As a temporary fix i have tried to set my snap spacing to .0001 to keep the crosshairs running smoothly but they still appear excessively jumpy at about 1 unit. This only happens in plotable drawings that contain a certain 2D xref and the offending xref itself. If i unload all the xrefs the problem DISAPPEARS, although this doesn't let me draft any easier!
My OSNAP is working fine although it does reset itself when i have been using certain LISP routines.
FYI, if I open the same drawing on another users computer the SNAP stays off and the crosshairs run smooth.