AutoCAD Visual LISP / AutoLISP :: How To Attach Classification Definitions To MEP Objects
Nov 25, 2011
The CADdesigners have asked me if i can make a function that runs through our AutoCAD 2012 MEP model attaching certain predefined classification definitions to ducts, pipes, MVparts etc.
I have used hours searcing for examples / tutorials on how to connect to the MEP objects not finding what i need.
View 5 Replies
ADVERTISEMENT
Oct 24, 2013
Is there a way to attached an already exisiting placed block to a leader. If so, is there a way to do it to all the existing blocks, that are of the same block definintion, at once?
View 2 Replies
View Related
Feb 7, 2010
How can I get the layer that an entity is on. I have tried numerous method but they don't seen to be retrieving the layer information.
View 8 Replies
View Related
Nov 26, 2012
how to delete all OLE objects from drawing by most efficient way.
There are abt 150 drawings, each has from 2 to 20 or so OLE objects which need to be deleted. OLE objects are on many paper spaces.
I tried to use qselect but it selects only what is in current space.
Would need some lisp or some other methode than all can be deleted (excluding those which resides in blocks).
Tried also yto use ssx and then erase but still it deletes only what is on current space.
Just as additional info, those OLE are all pictures, not xls files for example.
View 8 Replies
View Related
Mar 7, 2012
I am trying to add a reactor, where if the object i move or copy is s a block of a certain name, then i would like to run update field on the last object (being copied) or the object being moved.
View 4 Replies
View Related
Jan 11, 2013
The below adds a hyperlink to the selected object.How might it have to change to add multiple hyperlinks?
(entmod
(append (entget (car (entsel)))
(list
(list -3
(cons "PE_URL"
(list
(cons 1000 "..\..\90 Submittals\90-3 O&Ms\fig83-clevishanger.pdf") ; Relative Path to a pdf file.
(cons 1002 "{")
[code]...
View 3 Replies
View Related
Sep 19, 2011
I have been searching for some information on how to pass objects into a function so I can mess with their properties. Somehow I haven't been very successful. Anyway...What I want to do is take two items (light fixtures) and swap their positions on the drawing. It seems like it must be really simple, but I'm just not finding the key puzzle pieces to do it. It seems like if I could figure out how to pull two objects into the function (whether by selecting them and running the function or by selecting them after I run the function) I could very easily save the coordinates of one to variables and then just swap them.
View 9 Replies
View Related
Jan 6, 2012
How to export to a txt file a list containg all the objects on the current layer and their properties?
To be precise, I would like to export the following items from a selection of plines:
- ObjectID;
- Start Point;
- End Point;
- Vertex Points;
- Width.
View 3 Replies
View Related
Jan 2, 2012
with a function like this I added some xdata, some MULTILEADER
(defun c:add_xdata () (princ "Select: ") (setq ogg (car (entsel))) (addXdata ogg "TEST" "CODICE" "1256") (addXdata ogg "TEST" "MATERIALE" "LEGNO") (addXdata ogg "TEST" "TIPO" "A"))
Now with the following function can only select leaders who have linked the xdata application TEST
(setq selez_all (ssget "X" '((0 . "MULTILEADER")(-3 ("TEST")))))
I can not, however, find a way to select all MULTILEADER who have a particular value of XData.
For example I would select all MULTILEADER with MATERIALE = "LEGNO" and TIPO = "A".
View 4 Replies
View Related
Nov 2, 2011
How to modify this routine so that I can select multiple objects as opposed to one at a time?
(Defun c:cd ()
(setq newdim (entsel "
Select Dimension to clear:"))
(setq newdimvalue " ")
(command "dimedit" "n" newdimvalue newdim "")
(princ)
)
View 9 Replies
View Related
Nov 3, 2008
I have a lisp I use to calculate the area of an object. The section below is the area part of it:
(setq ojt (entsel "Select object to get area of... "))
(command "area" "o" ojt)
(setq oarea (getvar "area"))
I want to modify it to add the areas of multiple objects. Unfortunately it is not as simple as;
(setq ojt (ssget "Select object to get area of... "))
(command "area" "a" "o" ojt)
(setq oarea (getvar "area"))
So how would I go about doing it?
View 7 Replies
View Related
Jun 20, 2012
is it possible select all ANNOTATIVE objects in a DWG and to set a Viewport/ANNO scale for all via lisp
View 3 Replies
View Related
Sep 24, 2012
I have made a lisp routine to draw lines on polyline. And here are a lot of lines on it. So using comand
"(command "line" pt1 pt2 " ")"
takes a lot of time. Is here a way to creat lines in memory or similar and only then draw them all on screen?
I have search but coudin't find any info. I do not know how to formulate a query.
View 9 Replies
View Related
Jul 29, 2013
I want to move a large 3D steel file on top of a 2D architectural background. The ISSUE is that when i move it (in plan view "aka top view") the X,Y coordinates change AND the Z coordinate changes... But, I want the Z coordinate to stay the same . I wrote a LISP file that doesnt seem to work (SEE BELOW):
(defun C:MoveXY (/ PT1 PTB PT2)(setvar "CMDECHO" 0)(setq PT1 (getpoint "
Specify Base Point or [Displacement] Displacement: ")PTB (getpoint "
Specify second point or <use first point as displacement>: ")PT2 (list (car PTB)(cadr PTB)(cddr PT1)))(command "_.MOVE" (SSGET) "" PT1 PT2))
It seems my issue comes when i get to the command line (ssget) seems to mess it all up . How to use the ".Move" command with the (ssget) function?
View 7 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
Nov 26, 2013
I find that the command to move objects to a different layers runs very slow in one of the drawing. I want to find out what wrong with the drawing and how to speed things up.
I have a LISP program that batch processes a large number of drawings. One of the step to process each drawing is to change the colors of some objects according to the status of the objects. I do this by moving the objects to a later that has the right color. So far the program only takes 2 to 4 minutes to process each drawing. But the program takes close to 90 minutes to process one specific drawing. I track down the problem has to do with the command that moves the objects to the right layer, like this:
(vl-cmdf "_.chprop" (ssget) "" "_layer" "ABC-Prod-Good-Pcs" "")
This command takes a very long time to finish, like 40 minutes each time it runs (to move 1200+ objects), and the program needs to run it twice for a total of approximately 80 minutes.
Please note that the drawing itself is not the largest drawing, and it doesn't have the largest number of objects to be moved either. It is close to the top-5 drawings in term of drawing size and the number of objects to be moved. I cannot say that the drawing size or the number of objects to be moved are the cause of the problem.
I tried to "speed up" by moving 200 objects incrementally. That didn't work. I tried to "speed up" by moving 100 objects incrementally and saving the drawing after each 100 objects are moved. That didn't work either; actually the speed is slightly slower than simply moving 1200+ objects all at once.
I don't know what to do. I believe there may be something unusual about that drawing. By the way, the reason why I choose to change color by moving objects to a different layer has to do with the fact that I have found this is the best way so far. I tried to change the color of the objects directly. But I find that the color of some sub-parts of the objects are not changed (because their color is by-layer). That's why I choose to change color by moving objects to a different layer.
How I can check the drawing, any different way to change color that is better.
View 5 Replies
View Related
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
Jan 8, 2014
Any Lisp Routine to scale text objects a certain value and have the program actually scale each text object as you pick them.
The change text height using the Properties function does not work for what I need because the objects I need to scale are Mtext objects with Background Mask, and when you use the Properties function to change their text height it messes up the background mask so that you have to select each text entity and stretch the mask area smaller or larger, but if you use the scale function it scales the background mask as well so the background mask coverage is still the same.
View 2 Replies
View Related
Nov 27, 2012
I have this code that I wrote years ago that I want to update to select two types of civil3d objects and show them selected with grips on the screen. This function works fine
(defun CELFEATURE ()
(ssget "_X" '((0 . "AECC_FEATURE_LINE")))
(setq sset (ssget "P"))
(if sset
(progn
(sssetfirst sset sset)
;(command "_.PROPERTIES")
)
)
)
(defun cF () (CELFEATURE))
but if I add the extra object like this which I assume is the wrong syntax i only get the second type of objects. Need correct syntax I should be using for selecting more than one object in an ssget statement.
(defun CELFEATURE ()
(ssget "_X" '((0 . "AECC_FEATURE_LINE","AECC_AUTO_CORRIDOR_FEATURE_LINE")))
(setq sset (ssget "P"))
(if sset
(progn
(sssetfirst sset sset)
;(command "_.PROPERTIES")
)
)
)
(defun cF () (CELFEATURE))
View 2 Replies
View Related
May 4, 2013
I want to make it so that I can keep selecting several objects and get all the starting points and endpoints of each one with (setq ent (entsel))
(Defun c:demo (/ ent)
(setq ent (entsel))
(princ)
)
View 9 Replies
View Related
Jan 1, 2014
I am having trouble moving an object a certain distance. The distance is defined by a pre-defined variable. I just can't figure out the syntax for the autolisp command.
Here is the bit of code if written, there is more code not shared here that defines the points for the polyline .
;-- the varaible box_height is defined earlier in the routine
;-- Draw the polyline for the top of the cabinet
(command "pline" p1tt P2tt P3tt P4tt P5tt P6tt P7tt P8tt "c")
;-- Assign the new part a variable name
(setq cab_toppl (entlast))
;-- Extrude the polyline to make the top of the cabinet
(command "extrude" cab_toppl "" cab_intw "0")
;-- Assign the new part a variable name
(setq cab_top (entlast))
;-- Rotate the top of the cabinet down to the floor of cabinet
(command "rotate3d" cab_top "" 2 p1tt p2tt 90)
;-- Move the top of the cabinet to the final location
;-- HERE IS THE PART I'M HAVING TROUBLE WITH. ESSENTIALLY ONCE THE PART IS CREATED I'VE NAMED IT CAB_TOP AND AM NOW TRYING TO MOVE IT IN THE Z AXIS THE DISTANCE DEFINED BY THE VARIABLE BOX_HEIGHT WITHOUT USER INPUT
(command "move" cab_top "" "0,0,0" (list (0 0 (box_height) "")
;--THIS PART IS OKAY
(setvar "CLAYER" oldlayer) ;restore active layer
(setvar "BLIPMODE" 1)
(setvar "OSMODE" 135)
View 1 Replies
View Related
Sep 2, 2013
I have drawings with a lot of polyline objects. I need a routine which will draw multilines by coordinates of vertexes of this polylines. For example, if there is a pline with coordinates 10,10 - 20,20 i want to draw in other layer MLINE with the same coordinates. I know it's should be simple but can not gues how to do it. I've never used LISP before.
View 5 Replies
View Related
Oct 26, 2012
I would like converting all objects that has forced linetype to be on a linetype layer.
So if there are objects that have forced linetypes - dashed/hidden/phantom, etc., those entities would be moved to a linetype layer based on their forced linetype. The entities would all be changed to color bylayer, linetype bylayer.
So if there is a rectangle that is sitting on an EQUIPMENT layer, the routine would put that rectangle on a new layer called DASHED and change its forced linetype to BYLAYER.
Lastly, once that's done, the next and final step is to locate a the existing layers with matching linetype - say, OBJECTS with DASHED as a linetype, and merging it to that layer.
View 9 Replies
View Related
Oct 17, 2011
I was hoping to use find and replace "#" with broken fields in the drawing. but it will not find the # value that the field creates when it is broken. Is the only way to find a broken field a visual check? or is there another way I am not aware of?
View 5 Replies
View Related
Nov 17, 2011
I am creating a selection set using ssget...
Then I copy that selection set multiple times in a loop. What I would like to do is then rotate (or otherwise modify) the last copied group of items. If I rotate "last" it will only accept the last drawn item, so only one item in the group of copied objects will rotate.
Here is the portion of simple code I am using right now (it's in a loop so all variables with 'Next' are changing each time):
(command "_.copy" SS1 "" SS1Base NextPT)
(command "_.Rotate" "l" "" NextPT NextAng)
This works fine with a single object, but I can't figure out how to call up the entire group of objects.
Civil 3D 2011
Windows 7 x64
View 6 Replies
View Related
May 30, 2013
Can I have a lisp to select all objects in the layer "Defpoints" (including model and paper space, and including objects inside blocks) and change the color of those objects to color 30?
View 7 Replies
View Related
Sep 5, 2013
I am trying to select multiple objects and change them. However, the following code lets me only change one at a time. Even when I select a window around obejcts, it only changes a single item.
start of Same_Cannoscale.lsp(defun C:SCS ( / anno-v ent dict cansc entsc sc-list test oce)
(setq anno-v (getvar "ANNOALLVISIBLE")) (setvar "ANNOALLVISIBLE" 1) (if (= (getvar "CVPORT") 1) (princ "
In Paperspace. ") (if (setq ent (ssget ":S:L"))
[Code] ........
View 5 Replies
View Related
Sep 18, 2012
Is there any way to use the command "LAYCUR" to change all objects that are in the same layer? With a lisp, maybe?
View 9 Replies
View Related
Jul 29, 2013
lisp program to delete all objects in a drawing based on Layer excluding one layer objects.
in AutoCAD.
Example : I may have 10 layers in a drawings like 1 to 10. I need to delete all objects on 2 to 10 layers.
View 9 Replies
View Related
Dec 22, 2012
I have a slightly unusual query that I can't seem to find a solution for elsewhere. I have an existing OS plan that is 'off grid', and would like to adjust the vertices at the ends of all the existing lines and polylines so that they all sit on a grid point, ie round all vertices to the nearest whole number. Is there a quick command or script that does this?
View 2 Replies
View Related