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
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.
I am just starting learning lisp, And I am looking for a fast way to select multiple objects (usually circle) and export their coordinates and ID into a excel sheet through lisp programming.
As you might see in the attached drawing, the red circles are objects wanted. I have been trying to export their coordinates as well as their IDs in grids, e.g D28, Easting: Northing: . I still haven't found a good way to export ID for each circle.
As my code doesn't work, I wonder what's the most effective way to detect errors in lisp
I've been twigging around with a selectionset, but no luck. I need to build a ss with several named blocks and a few dynamic blocks which get selected as anonymous. Unfortunately not all dynamic blocks should be selected and I can find no way of either filtering out a list of dynamic blocks to exclude nor any way to campare to a list of dynamic blocks that I want selected. Below is the best idea that I had but if I wrap it into a foreach with an exclusion list, I get an empty selection set returned. (I'm guessing that I need to trim the pairs each iteration and only return the matches instead.)
The other code is long and I'd rather not confuse things; if I do not try to filter out any Unames, then everything works great and fast. Once I add in the "foreach i blklst" the code breaks and I get:
I wonder if I have to check if the "ssget" is empty.
I have a lisp to zoom extents in visible objects on the screen.
My interest is to filter before applying:If I have selected objects, it zooms in these objects. If I'm not have selected objects, continue as it is today, applying a zoom in the visible scene.
The result would be similar to a zoom of "3dsmax" (press the Z key)
Is there any way to isolate an item in a list for a filter? I'm setting a filter for SSGET and know that I can use the dotted pairs and I know I can use logical comparisions but what I really want to do is filter a single varialbe in the DXF group 10. For example, I'd like to only get entities with a specific Z value in DXF 10. Or even better to filter for a specified range of Y value or X value in DXF 10. If I could write something like (cons 10 (list * * 8.0)) where the asterisks were wild cards, that would do it but I'm not aware of such a wildcard. Is there any way to isolate a portion of DXF 10 in the filter?
I have some strings like the ones below. They are always in the same format. The first line is Cold Water, the second is Hot Water and the third is Hot Water Return.
I want to build a selection set based on whether it is CW, HWS or HWR. Right now I have a routine to retrieve the string by using ENTSEL. In other words if I want to use the line of text for Cold Water I have to select it.
I'd like to be able to window them all and filter the SS for only the string containing CW and conversly HWS and HWR. SSGET function filter.
Distinctions between AutoLISP functions ssget and C# PromptSelectionOption method.AutoLISP ssget function is apply a function with no options and does not require an object selection.pre-selected target object should respond to the selection set.
However, and C# PromptSelectionOption, ignoring the pre-selected objects, select the new object is required.using the features of C# Prompt Selection Option expressed AutoLISP ssget do the same in,
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
I have a data structure called LayerList in the format [LIST "LayerName" "Linetype" Thickness Color]I then use the following piece of code to go through the structure selecting polylines and converting all polylines on a given layer to the correct thickness
(foreach layr layerlist (setq player (car layr)) (if (setq ss (ssget "x" '((0 . "*polyLINE") (8 . player ) ))) (command "pedit" "m" ss "" "w" 0.15 "") (princ " No polylines exist!") ) )
However all i keep getting is Bad SSGET list value at the command line,
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] ........
I don;t know what happen with this piece of code, I have checked it a million of times and seems to be well done. I'm trying to filter a previous selection and select Text or Mtext objects that are in the layer COTREF, and that contain the strings "%%c" AND "L" at the same time. The problem is that the code it's not selecting objects with the "L" included.
The most unreasonable thing it's that I have 2 text objects exactly the same and when using this filter codes just one object it's selected (cyan cloud), check included DWG file.
I'v been searching about it and seems some persons are having problems with ssget filters in the newer versions of AutoCAD, I'm using 2012. I'm also suspecting for the character "%" which could be working as a wild-card, but as far as I know it is not.
The title says it all, Im trying to find a way to select just the vertical dimensions. Quick select doesn't work because there's no difference between a vertical and a horizontal dimension, so i was wondering if there was a LISP or something else i could do to accomplish this.
I am still green at lisp creation. I would like to create a lisp to change my cannoscale to match that of an existing dimension in model space. we use tabs and therefore have many different scales for the vports in our drawings. i want to be able to type my command, have acad ask for a annotative dimension to match, i click it, then the lisp resets my cannoscale to match.
I wrote this small program to automate plotting a drawing to pdf. Everything work fine except I cannot figure out how to allow it to let me pick where I want the file created and what I want to call it. In this routine, the "" at the 3rd from the end place will just automatically name the file and put it in the parent folder. If I replace the "" with pause, it lets me change the name, but will not let me choose the location.
What I'm looking for is for a dialogue box to pop up (explorer style) that will let me choose a location and name the file. This is what happens if you do it "long hand" inside ACAD, how to do it in the code.
I used to have a lisp routine that would allow me to pick one dynamic block and it would select all instances including the blocks that have become anonymous.
I'm trying to complete the code to select a p-line on layer G-POLY-GSF w/o asking for input. this (setq ent (ssget "X" (list (cons 8 "G-POLY-GSF"))) dosen't seem to work. What I'm I missing here?
(defun cf8 (/ ent dist obj) (vl-load-com) (setq ent (car (entsel " Select line to offset: ")) ;(setq ent (ssget "X" (list (cons 8 "G-POLY-GSF")))
Ultimately I want to delete a bunch of Layers by selecting them using a portion of their name. Is there anything in cad that allows you to specifically select layers using only a portion of the layer name?
Based on AutoCAD Layer Standards: Users label layers with a code; for example: A-ANNO-TEXT
A - Stands for the Architectural Category the layer falls into
ANNO - Stands for Annotation
TEXT - Type of Annotation
I want to use the Layer Delete (-LAYDEL) command to delete all layers that begin with A-ANNO. In the Layer Manager (-LAYER) I am able to select specific layers using a " * " placed before and/or after " A-ANNO " to include all layers with that in its name.
When I write a script however (-LAYDEL); cad will ask me for the layer name, but will not allow me to use the *A-ANNO* to include all layers with that name: A-ANNO-TEXT, A-ANNO-GLAZ, A-ANNO-WALL, etc...
Is there anything in cad that allows you to specifically select layers using only a portion of the layer name??? I have to "taylor" drawings that I receive from companies who's layers may vary.
My script is in basic (NON LISP) language:
-LAYDEL N A-GENM N A-DOOR N A-DOOR-FRAM N A-DOOR-GLAZ N Y
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.
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.