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


ADVERTISEMENT

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 :: ObjectDBX Access To Block Definition

Feb 22, 2013

Can't you access the block definition via ObjectDBX.

(without the dwg file being open)

I am parsing through the blocks to find all the xrefs. 

When I get to an XRef... I don't seem to find a way to check if it's an XRef.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Purge Using ObjectDBX Is Deleting Dimensions

Dec 21, 2012

I'm working up a routine to simplify clearing some space. I've been cruising here and other places piecing together something, but what I have ended up with is a routine that deletes all of the intended information (possibly needing repetition for those hard-to-reach blocks), but also deletes dimensions from the model space.

There are several things our company does which are "non-standard" but we have been at it for a while and I am trying to work with what I was given. Following is the code.

;;; not sure who Jeff M is, but assuming this bit is from him(defun odbx-test (/ dbx_doc) ;; edited 5/28/06 by Jeff M (if (< (setq dbxver (atof (getvar "ACADVER"))) 15.06) (progn (alert "ObjectDBX method not applicablein this AutoCAD version" ) (exit) (princ) (gc) ) (progn (if (= (atoi (getvar "ACADVER")) 15)(progn (if (not (vl-registry-read "HKEY_CLASSES_ROOT\ObjectDBX.AxDbDocument\CLSID" ) ) (startapp "regsvr32.exe" (strcat "/s "" (findfile "axdb15.dll") """)
[code]....

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Bind Xref Via ObjectDBX Without Opening

Feb 11, 2013

is it possible to bind an an xref via ObjectDBX without opening the drawing?

View 1 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 :: 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 :: Removing Last Characters Of Block Name In Selected Object?

Jul 29, 2013

When i export revit drawing with revit family 

the revit family become block in autocad like this

M_Single-Flush - 700 x 2200mm-278353-Ground Level _0_45

usually i want to remove the ID and view name to become like this without have to re type because it is tedious

M_Single-Flush - 700 x 2200mm

something like how many letters you want to remove from last to first ?

or something better like remove this last two dash and the letters embedded inside ( that separate name-ID-View name)  -278353-Ground Level _0_45?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Determine Type Of Object That User Selected?

Mar 1, 2012

Is there a way to determine the type of ACAD object that the user selected? I need to retrieve the value from either a dimension or text. The info could be in either format so the lisp routine needs to determine what was selected so the correct vla-get command is used.

Once I determine what the object is I can use an if statement to retrieve the value.

;user selects the object
(setq dimobj (vlax-ename->vla-object(car(entsel))))
;If ACAD object is a dimension do this.
(setq dimvalue (vla-get-textoverride dimobj))
;If ACAD object is text do this.
(setq dimvalue (vla-get-textstring dimobj))

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Total Length Of Selected Object And Summarize Them A Table

Jan 4, 2014

I need a lisp file that can read the total length of selected object (lignes, polylines) and summarize them by layers or by color in a table

e.g

command:tl (total length)
select objects
found total length.......
select object (Ent)
total length or [Add/Subtract/Table] :
total length = .......
if table
Enter an option by [ Layer/Color/line Type/line Weight] <layer> :

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Larger Routine To Create And Rotate Text Based On Object Selected

Dec 29, 2011

the expression in question is part of larger lisp routine to create and rotate text based on the object selected and the viewtwist variable (we use dview twist to rotate our views when needed)

So the expression in question:
(< (/ pi 2) ang (* pi 1.5)
where ang is the total angle used to determine proper rotation of the text.

Now the problem. In most cases where ang = 90 (or 1.5708 radians) this works fine. the two exceptions i have encountered

in testing are a line at 70 degress, viewtwist 20, and line at 50, viewtwist 40. For whatever reason at these two conditions the expressoin evaulates True instead of nil and rotates the entire text object incorrectly (180 degrees). So question is how exactly is this being evaluated? i know its comparing ang (* pi 1.5) to (/ pi 2). is there some sort of rounding error? or maybe the expression needs a wee bit more definition? attached image and full lisp routine for reference of what is happening, blue text is angle of the line as created by routine at viewtwist 0.

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

AutoCAD Visual LISP / AutoLISP :: How To Select All Tangent Surfaces To A Selected Surface

Nov 13, 2011

i.e. it would be usefull for separating the top and bottom of a sheet metall or plastic part.

Other cad systems I have seen have a function to do this automatically....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Delete All The Dimensions Inside Selected Block?

Dec 2, 2010

I need a lisp routine which will delete all the dimensions inside selected block or blocks, including nested blocks inside.

View 9 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 :: Align Block With Two Selected Destination Points

May 13, 2013

I am trying to write a program to align a block with two selected destination points. 
- first the user is prompted to select a lwpolyline of a block entity
- then he is prompted to pick two destination points

I face problem with the sub-routine SegmentPts. It is supposed to return the coordinates of two vertexes on both sides of the picked point on a lwpolyline using entsel. But here in my program, when i am picking a point using entsel on a lwpolyline inside a block entity, it is not returning the two vertexes on both sides of the picked point. In stead, it returns some other points of the selected LWPOLYLINE. Why it is doing so? Where is the problem in my program?

It works fine with my other programs where i pick on a LWPOLYLINE entity. In this particular case, the LWPOLYLINE is inside a Block entity and the program is not returning correct points.

Please check Lisp Program below:

(defun C:alb()
(setq ent1 (entsel "
Pick on one side of LWLINE ofa Block:" ))
(setq ent (nentselp (cadr ent1)))
[code]........

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Possible To Pull Out Coordinates From Object When Object Snap Applied?

Aug 29, 2011

I have a rather simple 3rd party custom object... I tried to get its bounding box but the coordinates that come back don't seem to relate at all to the object.

What I'd like are the coordinates of two nodes the object contains...

Is it possible to apply the autocad cursor in some why with the node object snap to get their coordinates?

View 4 Replies View Related







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