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
ADVERTISEMENT
Feb 21, 2013
I need to get VLA-Object from block name.
here there is a code to get block name from VLA-Object:
(vlax-get-property obj (if (vlax-property-available-p obj 'EffectiveName) 'EffectiveName 'Name) )
but I need the inverse of this code exactly:
blockname(as a string)==>VLA-object
(defun GetVLA_BName (BName).......
so, how can I do it?
View 9 Replies
View Related
Mar 15, 2013
I am trying to write a simple (or at least I thought it was) code to flatten a 3d object into a 2d shape. For some reason after ACAD runs the lisp it recognizes the flatten command but it will not select all. this is what I have:
(defun c:fl () (command "flatten" "all") )
I have even tried the pick first command, to select all then run the flatten command but that still doesn't work.
View 5 Replies
View Related
Jun 19, 2013
How to access the information stored with an AcDbScale object using Visual Lisp. I can convert the vla-object to an ename and then use association codes to extract the data, but surely there's an easier, more direct alternative.
View 9 Replies
View Related
Jun 24, 2012
How to fade an object (block) in and out?
View 2 Replies
View Related
Dec 9, 2011
i am trying to add a reactor to ddatte command, would like to know which object was being edited, the ename or object name (ssget "P") does not seem to be the one
View 5 Replies
View Related
Nov 10, 2011
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.
View 7 Replies
View Related
Nov 1, 2011
We use multi-leader objects in our drawings. When the multi-leader and its value are to be replicated throughout the drawing, we create mleaders with fields that show the contents of the first mleader. That way we can update only the value in the first mleader and all of its children will update as well. It works nicely for us.
Here comes one snag. If one of us opens a drawing with which we are not intimately familiar, we don't know which mleader is the parent of which children. There might be fifty parents and four hundred children in a drawing so going through them by hand is a big productivity drain.
What I need to do is write a routine that will let the user select the mleader that includes the field and have the routine highlight and/or zoom to the parent object.
I thought I should be able to find that info in the dxf codes for the mleader, but I am either missing it or it's not there.
View 3 Replies
View Related
Nov 12, 2013
I am creating a line using entmake, but I need the start and end point to be variable that was already defined ex.
(entmake '((0 . "LINE")(8 . "FIELD") (10 . line_insert) (11 line_end)))
Command: !line_insert
(29.2813 20.5 0.0)
Command: !line_end
(29.2813 18.5 0.0)
The error I get is
; error: bad DXF group: (10 LINE_INSERT)
What do I do to make it recognize this variable?
View 1 Replies
View Related
Feb 7, 2012
I use the following code to assign a reactor to an object.
Now I noticed that if I close the dwg file after you successfully saved, when I open even if I load the lisp, the reactor does not work.
Another problem: when I use the command "erase" or "explode" the reactor is started twice, why? you can run it at once?
(setq marReactor (vlr-object-reactor (list (vlax-ename->vla-object oggmar)) "TEST" '( (:vlr-erased . reactor_upd) (:vlr-modified . reactor_upd) ) ))
View 3 Replies
View Related
Jun 14, 2013
I have this lisp which will display the height of a 3D object to 2 dps. What I need is for 3dps to be displayed but I have no real understanding of LISP coidng so I can't work out where this is specified in the routine.
Why this LISP does not work when I try to use it in a drawing which has a Pointools POD file working (or previously had one) within it?
View 5 Replies
View Related
Sep 11, 2013
Having trouble with object snap tracking. At times i am given distances from other objects to work with- which is what i am after.
However in some instances only the model space coordinates are displayed- not distances. Is there any way to ensure that only distances appear?
View 7 Replies
View Related
Dec 14, 2011
how to do this programmatically and without modifying the handle of the object,i am trying to do it programmatically (entmod (cons 410 newname)(assoc 410 ... no luck.
(entmakex -ing will modify or create a new handle ctrl-X and then ctrl-V recreates a new handle too ...
View 9 Replies
View Related
Jan 29, 2013
I need to write some code to count blocks inserted on the drawing.... I want to count also dynamic blocks... most of the time dynamic blocks are anonymous... so I'd need to check the Effective Name.
This line gets the blocks in the block table...
... but how do I get the blocks actually inserted in the dwg?
(setq blks (vla-get-blocks odoc))
Will a regular lisp expressions (like below) work with ObjectDBX... (drawing file not open)?
(setq ss (ssget "X" (list (cons 0 "INSERT")(cons 2 "`*U*"))))
View 2 Replies
View Related
Nov 23, 2011
I've gotten these two routines from different threads on here. One works with *text and blocks. The second works with multileaders.
I'd like to merge the two so one command can work with a selection set of any of the above objects (assume selection set of mixed objects - some multileaders, some text, some blocks)
(defun c:at ( / ss ang *error*)(vl-load-com)(ErrorHandler '("cmdecho" "osmode"))(setvar "cmdecho" 0)(setvar "osmode" 576)(setqss (ssget '((0 . "*TEXT,INSERT")))ang (getangle "
Select two points along desired alignment:"))(mapcar'(lambda (x)(vla-put-rotation(vlax-ename->vla-object x)ang))(mapcar 'cadr (ssnamex ss)))(*error* nil))(defun c:test (/ ss ang i sset)(vl-load-com); Tharwat 17. 05. 2011 (if (and (setq ss (ssget ":L" '((0 . "MULTILEADER")))) (setq ang (getangle "
Specify Rotation Angle :"))) (repeat(setq i (sslength ss)) (setq sset (ssname ss (setq i (1- i)))) (vla-put-TextRotation (vlax-ename->vla-object sset) ang)) (princ)) (princ))
Or see C:AT and C:TEST in the attached file
View 2 Replies
View Related
Jun 20, 2011
A lot of the LISP routines we use turn off all snaps except the "nearest" snap when the routine is complete.
I draw with 6 out of the 10 snaps on (not the nearest).
LISP routine that loads specific object snaps?
View 9 Replies
View Related
Jan 3, 2013
LISP routine which will draw lines from the center/insertion point of multiple objects to 0,0,0 ?
View 9 Replies
View Related
Jul 21, 2003
Is there a lisp routine to draw 3D object by the LOFT way ? .
View 4 Replies
View Related
Aug 6, 2013
I discovered yesterday my burst lisp routine isn't working. It gives the following error message:
bad argument type: VLA-object collection: #<VLA-OBJECT 0971e1d4>
The routine does not appear to have changed. But here is the
(Defun C:BURST (/ item bitset bump att-text lastent burst-one burst BCNT BLAYER BCOLOR ELAST BLTYPE ETYPE PSFLAG ENAME ) ;----------------------------------------------------- ; Item from association list ;----------------------------------------------------- (Defun ITEM (N E) (CDR (Assoc N E))) ;----------------------------------------------------- ; Error Handler ;----------------------------------------------------- (acet-error-init (list (list "cmdecho" 0 "highlight" 1 ) T ;flag. True means use undo for error clean up. );list );acet-error-init ;----------------------------------------------------- ; BIT SET ;----------------------------------------------------- (Defun BITSET (A B) (= (Boole 1 A B) B)) ;----------------------------------------------------- ; BUMP ;----------------------------------------------------- (Setq bcnt 0) (Defun bump (prmpt) (Princ (Nth bcnt '("
-" "
\" "
[code]....
View 6 Replies
View Related
Nov 11, 2013
This is in regards to the LIP command in Toolpac. The layer properties for a selected nested object (LIP) used to default to nested. Now you have to select nested from the list of options. Why they would change LIP. My whole company had gotten so used to it.
View 4 Replies
View Related
Jan 1, 2014
I am trying to extrude an object in the negative Z direction.
Easy to do at the command line by putting a "-" sign before the distance to extrude the object but I'm having trouble in autolisp.
Define points for polyline for valence
(setq p1v p1)
(setq p2v (polar p1 (DTR 0.0) box_width))
(setq p3v (polar p2v (DTR 90.0) val_thick))
(setq p4v (polar p1V (DTR 90.0) val_thick))
;-- Create valence polyline
;-- Draw the polyline for the valence
(command "pline" p1v p2v p3v p4v "c")
;-- Assign the new part a variable name
(setq cab_valpl (entlast))
THIS IS THE PART I'M TRYING TO FIGURE OUT BELOW ....... WHAT IS THE SYNTAX TO EXTRUDE "VAL_HT" IN THE NEGATIVE DIRECTION?
;-- Extrude the polyline to make the valence
(command "extrude" cab_valpl "" val_ht "0")
View 6 Replies
View Related
Mar 30, 2012
how can I check whether an object has a reactor connected?
I wrote the following
(defun c:**** (/ ogg collegaReactor) (setq ogg (car (entsel))) (setq collegaReactor (vlr-object-reactor (list (vlax-ename->vla-object ogg)) "NOMEAPP" '( (:vlr-modified . testedit) (:vlr-objectClosed . endedit) ) ) ))(defun testedit (notifier-object reactor-object parameter-list / ogg collegaReactor) (alert "testedit"))(defun endedit (notifier-object reactor-object parameter-list / ogg collegaReactor) (alert "endedit"))
If I start two or three or more times the "c:****" and select the same object, when I changethe "alert" appear several times.
View 8 Replies
View Related
Jul 20, 2011
I want to create a routine that will place selected objects on a the corresponding demo layer. Here is the outline:
enter command
select object
extract layer name of object (i.e. "CS CURB")
if demo layer exists (i.e. "CS CURB CD")
>put object on demo layer
>else create demo layer, and place object on layer
I could select multiple objects on different layers.is this possible with lisp? any good starting point for lisp programing?
View 9 Replies
View Related
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
Feb 29, 2012
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")))
[Code]....
View 8 Replies
View Related
Jun 3, 2013
How to make a lisp command that will select all objects in the drawing?
View 3 Replies
View Related
Oct 19, 2011
Is there way get field object att in xref ?
View 3 Replies
View Related
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
Dec 2, 2013
I need to make all the obj like one pol after I select them all not just the last one so I can get the intersection of each obj1
(DEFUN C:CHF ()
(vl-load-com)
(if (not (member "geomcal.arx" (arx)))
(arxload "geomcal")
)
(command "undo" "BE")
(setq osm (getvar "osmode"))
(setvar "osmode" 0)
[code]....
View 5 Replies
View Related
Mar 13, 2012
I open the drawing without loading the function, when I modify an object with the reactors appears the following error message:
function definition: NAMEFUNCTION
You can avoid this annoying message without removing the persistent reactors?
View 3 Replies
View Related
Sep 24, 2013
I want to change all pline in drawing to a specific object color (color 253). My code is not working & my brain is not functionning properly today...
(DEFUN C:TR() (SETQ ALL_PLINE_IN_DRAWING (ssget "_X" '((0 . "LWPOLYLINE")))number_of_pline_in_dwg (sslength ALL_PLINE_IN_DRAWING)entity (ssname ALL_PLINE_IN_DRAWING 1)data (entget entity)new_LAYER (list(cons 62 253))data (append new_LAYER data))(entmod data));END OF DEFUN
View 8 Replies
View Related