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


ADVERTISEMENT

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 :: New Layer For Selected Objects

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

AutoCAD Visual LISP / AutoLISP :: Detect If There Are Objects Selected

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

AutoCAD Visual LISP / AutoLISP :: Smallest Rectangle Enclosing Selected Set Of Objects

Feb 27, 2013

How can I draw a The smallest rectangle enclosing for a selected set of objects in current drawing?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Loop Based On Number Of Selected And Filtered Objects

Jun 13, 2013

I am looking for a way to extract (filter) all polylines, and loop a lisp based on the number that are found within a "W" selection window.I am frustrated getting "malformed list" or errors, even after defining "n" for repeat.The code I have so far looks like this:

(defun cWW (/ p1 p2 sspw myObj ss)
(setq p1 (getpoint "
Pick first corner: "))
  (setq p2 (getcorner p1 "
Specify opposite corner: "))
  (if
   (setq sspw (ssget "W" p1 p2 '((0 . "*POLYLINE")))
 [code].....

Without the (repeat () portion, it was working ok with selection window, however it only would run the commands for a single polyline.  What needs to be done without overhauling the code?  The lisp has worked on a drawing-wide basis, however needs to run on only on user-windowed polylines since there are other polylines within the drawing which are attached to layouts via viewports. 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Move Existing Objects To Snap Grid?

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

AutoCAD Visual LISP / AutoLISP :: Copy / Move / Scale / Rotate Objects

May 24, 2002

Any lisp routine where you can select objects and do a global rotate, scale, etc. from each object's insertion point ?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Move Objects To New Layer Based On Their Present Layer

Jun 20, 2012

Say I have 2 items, one is on layer "M-Duct" and the other on "M-Pipe" (they are in the same drawing). Any lisp routine that would create the layers "M-Duct-New" and "M-Pipe-New" (based on the same color and LT as the original layers) and then move those objects to the newly created layers?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Put New Block Over Old One Using Properties

Aug 5, 2013

I would like to select all instances of a block, and put a new block on top of them using the same properties (insertion, rotation) but am unsure how to do this

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selected Text(s) To CSV Files

Nov 14, 2012

I need a LISP program that prompts: "select text(s)" then I select for example 100 text in open drawing file.

after that this program creat a file (LIST.CSV) and write each selected text in line by line of this file:

result text file (LIST.CSV ) should be:

Text1

Text2

Text3

...

...

Text99

Text100

 ofcourse Text1 is the content of a text object.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Delete DWG File Properties?

Mar 5, 2010

I am looking for code that will delete all the properties within a DWG file.

Searching the forum, I found the following

; Remove any existing Properties
(dictremove (namedobjdict) "DWGPROPS")

However, further research (forum, testing and help system) indicates that it no longer applies to current releases of AutoCAD so my initial happiness was short-lived!

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Prompt Text / Mtext Not Selected

Nov 13, 2012

I’m trying to put together a loop for if nil or something other than text or mtext is accidentally selected than prompt text was not selected. This is what I have so far.

text or mtext is not selected than prompt

(defun C:ww ()
(while
(not
(and
(setq esel (entsel "
[Code]......

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Show Difference In Selected Text?

Jan 17, 2013

I have a little routine to add two selected numerical texts together and show the result at a selected position. I am using the entsel method to select them. I would like a way to highlight the selected text temporarily. Is this possible. The routine is as follows.

(defun c:T+ ( / Txt1 Txt2 Txt3 Pkt )
 ;Adds second selected number to first
 (setvar "dimzin" 3)
 (setq curlay (getvar "clayer"))
 (setq curcol (getvar "cecolor"))
 (setq curlin (getvar "celtype"))
 (setq ds (getvar "dimscale"))

[code]....

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Attribute To Selected Blocks (XY Coordinates)

Nov 30, 2012

i have found the following lisp in a previous thread: (shows XY coordinates of the selected blocks)

(defun C:MyFunc (/ ss Index Ename Lst)
(while (or (not ss) (= 0 (sslength ss))) (setq ss (ssget '((0 .
"INSERT")))))
(if ss

[Code]....

I want this information to be added to the blocks as hidden attributes so that i can extract them by attout. The work to be done is : attout to excel, autofill an attribute (numbering) then attin.

but my problem is that i cant think of a way to number those blocks IN ORDER (ie top to bottom or left to right) unless by sorting them in excel first by their x or y coordinates

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Adding A Text To Selected Texts?

Jan 24, 2013

I need a LISP program to add a text given by user to all selected text.

in other words:

1- user selects some texts.

2- user give a text to program.

3- Program added this text to all selected text.

selected text: text1, text2, text3,text4,....,textn

given text by user: _xyz

Result:

text1_xyz, text2_xyz, text3_xyz,text4_xyz,....,textn_xyz

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change All Selected Hatches To Solid?

Apr 1, 2012

I need to convert a lot of different hatches to solid hatches.

I haven´t found a way to do it in Autocad 2012.

script that cycles to all selected hatches and change the properties to solid?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Getting Routine That Will Sum Selected Text Values?

Jun 2, 2004

lisp routine that will add together the values of text entities? For instance, if I have a big parking lot and each section is labeled with the number of spaces, I could pick the texts and it would add all the numbers together to give me a total. Right now I export to excel to do this. I have quite a few situations where this would be handy, not just for parking spaces, so I really just want a lisp that will add all my selected numbers.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Auto Offset For Selected Items

Jan 25, 2013

I wish to have a lisp than enable to do automatic offset base on some selection of lines ,circles or polylines object as shown in attachment.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Function For SELECTED ALL Object In Drawing?

Jun 3, 2013

How to make a lisp command that will select all objects in the drawing?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Vplayer Color Of A Selected Object

Sep 9, 2011

I thought this would be a simple tblsearch process, but as far as I can tell, there isn't a tblsearch symbol table for vplayer settings, so I need to get more creative I guess.

I want to be able to get the vplayer color of a selected object as part of a larger routine I'm putting together.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sorting A List Of Selected Block

Jun 12, 2013

I found a lisp for counting of selected block in a table drawing, but I can not remove the bottom line of this lisp that displays "total" blocks. How to remove this line from "total" that is created in the last row of the table that lisp.

lisp : ========================================

(defun c:TABL (/ blk_id blk_len blk_name blks ent h header_lsp height i j TOTAL
len0 lst_blk msp pt row ss str tblobj width width1 width2 x y
)

[Code]....

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Trim Selected Text(s) With A Divisor?

Feb 2, 2013

I need a program to trim selected text(s) with a divisor.

suppose that the divisor character is: "/"

(selected text==>result

textL/textR ==> textR

xxx/yyy     ==>yyy

t12x/5678  ==>5678

I should use some commands like:

;;;;div="/":

(setq str "xxx/yyy")
(setq pos (vl-string-position (ascii "/") str))
(setq len (strlen str))
(setq RGT (substr str (+ pos 2) (-(- len pos)1))) ;;=text after "/"

but I need a LISP program that:

1-ask user to give a divisor char: (Divisor character: </>)

2-ask user to select text(s) but program should filter selected text(s) with divisor (*/* pattern)

(if (null #div#)(setq #div# "/"))
(if (and
(setq #div# if (= (setq tmp (getstring (strcat "
Divisor character: <" #div# "> ") ) ) "" ) #div# tmp ) )
(setq ss (ssget "_:L" (list '(0 . "*TEXT") (cons 1 (strcat "*" #div# "*")))))
)

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selected Object Is In XRef To Highlight

Aug 15, 2013

I think there is a function that will cause the selected object that is in the XRef to highlight.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Properties On Multiple Drawings

Nov 6, 2012

Any lisp routine on how to change "Drawing Properties" (fields via Mtext) on multiple single drawing files?

There are several instances where we would need to take a project to create another one and simply change the title block description.

As of now, we are opening each drawing (there could be hundreds) and modifiying the drawing properties on each drawing to change the customer name and other project descriptions.

These are not attributes, but fields. I've researched alot on here and couldnt find anything.

The drawing is attached.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Update Custom Drawing Properties

Oct 1, 2012

how to access custom drawing properties using LISP.  It was in a discussion initiated on 01-06-2011, subject:  Custom drawing properties.

One solution was to use the following method:

(setq  si (vla-Get-SummaryInfo (vla-Get-ActiveDocument (vlax-Get-Acad-Object))))
(vla-GetCustomByKey si  "DWGPROP1" 'pval)
(princ pval)

Now taking it a step further, using LISP, how can I "update" my custom drawing properties?

Inventor RS 2011
AutoCAD Mechanical 2011
ASD 2013
Vault Collaboration 2011
Windows 7 Pro

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Customize PDF Creation - Open PC3 Properties

Oct 23, 2013

I'm trying create a LISP to customize PDF creation.  The lisp looks into the .PC3 file which paper size better fits the plot area. But its exaustive to every time i want to create a new paper size i have to open the .pc3 file and configure a new paper.

There is a way to open the .pc3 properties through lisp?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Edit Block Attribute Properties

Jan 26, 2012

I'm looking for a lisp routine that i can globally change the text height and width factor of a particular block attribute. The name of the attribute tag is "TAG". I would like to be able to select all the blocks that i need to edit and then specify what text height and width factor i want to change to.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Match Properties With Colors And Not By Layer?

Dec 30, 2013

I've been looking for commant that will allow me to copy a selection of entities to another layer for details. I'll need to be able to select several objets all at once and have each of them maintain the correct colors, linetypes, lineweights. Most everything is set as bylayer but that makes everything change once the objects are moved to a new layer.

How can I keep the everything looking like it never changed except for the fact that it will be moved to a new layer - layer 0 in this situation?

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 :: Find And Replace Group Of Blocks That Are SELECTED

Jul 17, 2013

I having real difficulty finding a lisp that will find and replace blocks.  There are plenty out there and AutoCAD 2013 and lower has a Find and Replace Blocks.  However, the frustrating catch is I can seem to find a routine that will allow me to replace only those blocks that I select with a selection set of my choosing.  The built in function replaces all of them and will not let you exclude some.  We have PID drawings that we want to replace valves on, but not all valves.  We don't want to rename.  We don't need to BEDIT the existing block. 

1) Pick group of blocks

2) specify a new block that will replace all instances of old block

3) replace inserted block with different block.  Leaving others alone.

I'm thinking this should be easy, but my search has failed.  The blocks in question are not dynamic or attributed either.

View 3 Replies View Related







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