AutoCAD Visual LISP / AutoLISP :: Find Position XYZ And Rotation XYZ Of Each Entity?
Jul 13, 2011
finding each objects Position XYZ and Rotation XYZ using LISP. It looks like position is a pretty easy one but rotation data is a bit elusive.
View 9 Replies
ADVERTISEMENT
Oct 10, 2013
I have a specific need to determine if an entity is existing or not so that I can either make changes to or create the entity. I'm trying to do this while referring to the entity by it's handle. Below is my code this far but it doesn't work.
(IF (AND (SETQ HNDL (VLAX-LDATA-GET "TB" (STRCAT PLN "PLAN"))) (NOT (VLAX-ERASED-P (VLAX-ENAME->VLA-OBJECT (HANDENT HNDL)))) ) (PROGN ;;| DO SOMETHING WITH THE EXISTING ENTITY ) (PROGN ;;| MAKE THE ENTITY
(vlax-ldata-put "TB" (strcat PLN "PLAN") (CDR (ASSOC 5 (entget (entlast))))) ))
I ran the program and the handle was stored, then I deleted the entity and ran the code again and this is the error I get:
; error: unable to get ObjectID: nil
This VLISP stuff sometime has unpredictable hoops to jump through first, so I wondering if this is the case here.
View 3 Replies
View Related
Apr 29, 2012
how to draw a text entity in 3d, where I know the 3d ins point, and the plane it should be flat to.
I have not drawn text or inserted blocks programatically before where the plane they lie on is not flat.
I have done it before by setting a ucs and drawing stuff, but now I want no switches of UCS involved.
[URL]
View 2 Replies
View Related
Mar 29, 2012
How can i build a selection set of all circles and then retrieve the xdata attached to them?
View 9 Replies
View Related
Aug 19, 2013
How do I get the angle of an Mvblock/wall or any other ADT entity to use in a lisp routine to set Snapang?
View 4 Replies
View Related
Dec 29, 2012
I am wanting to use autolisp to access the text in a MTEXT entity. assoc(1) gives me the first bit of text, but not the rest.Is there a way to use assoc to access each of a number of matches or do I need to write my own routine to find all the 1's?
View 5 Replies
View Related
Sep 15, 2011
I need to let the user pick on an entity to get an elevation.
I was using getpoint, with osmode set to nearest, but it allows them to pick 2d items under the 3d items I want picked.
Without doing fancy laer manipulation to turn off 2d stuff, are there any tricks to avoid snapping on the 2d item?
I am thinking I might do an entselp, then try again at same point until i get a 3d one (non 0.0 z coord).
[URL]
View 7 Replies
View Related
Nov 29, 2012
Is it possible to include a point entity (rather than a zero-length line as in the standard SQDOTS pattern) in a custom hatch pattern?
If so what's the exact format of the line in the .pat file that defines the point?
View 9 Replies
View Related
Feb 27, 2012
When we launch the list command, the Area system variable holds the area value of the selected shape.
How to get the length value into an Autolisp program to use it?
View 3 Replies
View Related
Jul 12, 2012
Is there a lisp that will allow me to do a continuous dimension, but will alternate the dimension position from low, high, low and high? If there is no lisp already created, how to create one?
See Continuous dimension attachment for example.
I work at a glass and glazing company and this is how we dimension mullion width and DLO. See typical window dimensioning attachment for window elevation with dimensions.
View 6 Replies
View Related
Nov 13, 2013
presuming I have a selection set of different entities, that might have different linewight.
The code that is responsible for this property is 370
370Lineweight enum value. Stored and moved around as a 16-bit integer.not omitted from here
I need to make all of the entities have the same layer, and to make sure the each entity has the "ByLayer" lineweight.
The problem that I encountered, is the lineweight changement.
This is the colution that I came with, but it doesn't work for me:
(defun c:test () (setq en (car (entsel))) (setq el (entget en)) (setq el1 '()) (setq indx -1) (repeat (length el) (setq indx (1+ indx)) (if (/= (nth indx el) (assoc 370 el)) (setq el1 (cons (nth indx el) el1)) ) ) (setq el el1) (entmod el) (princ) )
Having tested it in different ways, it looks like at the end, el1 represents the association list that I want my object to have, but it doesn't want to update.
View 9 Replies
View Related
Oct 8, 2013
I need to return the entity name of the largest (longest closed) polyline in a selection set. At this point I have no trouble creating the selection set and even getting the area of the boundingbox, which is not the most accurate way to find the true size, but it's a start. The part that has me stumped is: if I iterate through the selection set, then how can I compare one to the other when I have access to the current entity. I've been staring at examples of lambdas but it seems to me that iterating through the selection set is going about it wrong in the first place.
Below is my current code with a remaining issue. I can return the largest area of the polylines (no good for more than two entities in selection set), but I do not know how to return the entity name:
(IF (> (SETQ SS (SSGET "x" '((0 . "*POLYLINE") (8 . "POOL") (-4 . "<OR") (62 . 5) (62 . 256) (-4 . "OR>")))) 1 ) (PROGN (SETQ a (1- a) ent (CDR (CAR (SSNAME ss a))) en2 (CDR (CAR (SSNAME ss (1- a)))) ar1 (APPLY '* (LIST (LAMBDA (ent) (VLAX-INVOKE-METHOD (VLAX-ENAME->VLA-OBJECT ent) 'getboundingbox 'minpt 'maxpt) (SETQ pt1 [code]......
View 9 Replies
View Related
Apr 30, 2012
I use extended data on 2d entity in AutoCAD 2010. In a lisp program, I have filtered with extended data selection. Filters work with entity like: line, polyline and Mline but with insert entity it don’t work.
The end get result for a block :
((-1 . <Nom d'entité: 7ffffbe7d90>) (0 . "INSERT") (330 . <Nom d'entité: 7ffffb039f0>) (5 . "18CA91") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "Fam_POTEAU_ROND_INSERT_021") (100 . "AcDbBlockReference") (2 . "POTEAU_ROND") (10 155239.0 -100209.0 0.0) (41 . 16.05) (42 . 16.05) (43 . 16.05) (50 . 0.0) (70 . 0) (71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 1.0) (-3 ("CREEMET000" (1000 . "Fam021") (1040 . -14.0) (1040 . 434.0) (1071 . 0)) ("CREEMET001" (1071 . 2) (1071 . 3) (1071 . 0)) ("CREEMET014" (1000 . "Poteau rond mixte (a completer)")) ("CREEMET002" (1000 . "_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_-1_-1_-1"))))
The filter list use :
((-4 . "<OR") (2 . "POTEAU_ROND*") (-4 . "OR>") (-3 ("CREEMET002" (1000 . "_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_-1_-1_-1"))))
View 3 Replies
View Related
Jan 2, 2013
Just recently I have noticed a Major problem occurring with Xdata. My programs that i use XDATA storage in work fine until you save the drawing. When you call the file back up the Xdata is gone the only thing in the xdata is NameSpace value. Is this related somehow to a Windows update?
View 2 Replies
View Related
Dec 6, 2007
I have a program that makes 3d polylines from various data. That 3d pline then gets added to a civil 3d surface as a breakline. I want to modify the pline with my program, but preserve the handle, as I think that is what C3D uses to decide if its part of the surface. I tried this as a sample with no luck:
;DELETE 3RD VERTEXT FROM 3D PLINE
(DEFUN C:T3 ( / EN ENAME ENT ENTL)
;GET 3D PLINE
(SETQ ENT (ENTSEL "
Select 3D Pline:")
[Code] .....
I know you can modify a vertex, but what about add and delete with entmake and entmod? I also considered using activex for this task, but you can only add verticies from what I could tell in the object browser of VBA, not delete them.
What I will be doing is deleting all the verticies and adding back the correct ones. Or if there was a way to transfer a handle to a new entity after deleting the old, that would suffice too.
View 9 Replies
View Related
Aug 22, 2012
I have a Lisp that I have been working on with some folks in the office, and i feel like i am close, but i am not getting the cigar. The idea would be to have the lisp allow the user to select a nested x-ref entity, and change the color and linetype of the selected layer, similar to the old "LAP" command (I know it is a dinosaur, but I still miss it). I seem to be doing swimmingly, code I have quasi-plagiarized. It seems to crap out where i try to pass the selected linetype back to the layer. I get the nastygram "Command: ; error: no function definition: GETLINETYPE" right after selecting the linetype from the dialog.
Code below...
x(defun c:CX (/ Sel EntList DataList cnt Num ClrNum EntData)
(if (setq Sel (nentsel "
Select object to change layers color and linetype: "))
(progn
[Code]...
HP Elitebook Workstation
Windows 7
View 6 Replies
View Related
Oct 28, 2011
I am looking for a function to print out the entire entity list of the selected entity...
so... walking down through the entity data... print out what it finds... any time it encounters an entity name... then do an entget and print that out too.
View 8 Replies
View Related
Nov 6, 2013
I am looking for some code that would allow me to select a MTEXT Entity - or other entity - (as the DEFAULT option) but also to allow me to type in some text manually or to pick a point in the drawing. Something that would present the user with:
"Select an object or [P to pick a point]" or
"Select MTEXT or [M to type].
I can write some code to type in text manually as the default option and get the second option to select entity using get string and then write some condition of if code but I don't know how to do it having entsel as default option.
View 3 Replies
View Related
Jun 27, 2012
How can I get the position (POPn ) where a menu is, considering the other menus loaded (ACAD, Expres.. etc)
For example:
File Edit View Insert . .Express WIndow Help DOBLADO PCSMEN. .. and I need to know the position of DOBLADO.
View 7 Replies
View Related
May 8, 2012
After (set_tile "gg" varname) to an edit_box Can one automatically place the cursor at the end of the edit_box string?
View 3 Replies
View Related
Mar 22, 2012
how to create a text selection set using rotation and oblique angles. I am working isometric drawings from a Microstation conversion and want to create a lisp to set text style to conform to current standards. For example, iso text in the right plane would be rotated 30 degrees and have an oblique angle of 30 degrees based on the style from the conversion. however,
(setq txtisor (ssget "X" '((0 . "MTEXT,TEXT")(50 . 0.523599)(51 . 0.523599)))) returns nil.
since (setq txt0 (ssget "X" '((0 . "MTEXT,TEXT")(50 . 0)))) returns all text at zero degrees, I figure there is something wrong about the way the angles are being entered.
View 9 Replies
View Related
Jan 11, 2012
Where is this data stored?
Geo Location
Sun Source vector (I can see it in the "Sun & Location" Panel)
But how use this data.
In attachment you will see sample drawing with all this information.
How can I find them with lisp?
View 1 Replies
View Related
Oct 24, 2011
what is the lock position dxf, when entmaking a block with attributes ?
View 1 Replies
View Related
Oct 7, 2011
There are a ton of lisp to match text rotation to a selected line, but not vice versa.
View 9 Replies
View Related
May 2, 2013
I am trying to entmake a hatch entity from a hatch template.
After entget the template hatch entity, i get the followings
Select object: ((-1 . <Entity name: 7ed11b78>) (0 . "HATCH") (330 . <Entity
name: 7efc7c10>) (5 . "737") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 .
"SECTION-LABEL") (62 . 255) (100 . "AcDbHatch") (10 0.0 0.0 0.0) (210 0.0 0.0
1.0) (2 . "SOLID") (70 . 1) (71 . 0) (91 . 1) (92 . 1) (93 . 8) (72 . 1) (10
633596.0 5.79713e+006 0.0) (11 633519.0 5.79713e+006 0.0) (72 . 1) (10 633519.0
5.79713e+006 0.0) (11 633519.0 5.79708e+006 0.0) (72 . 1) (10 633519.0
5.79708e+006 0.0) (11 633500.0 5.79708e+006 0.0) (72 . 1) (10 633500.0
[code]....
Now I wrote the following code using the above data as follows
(entmake (list (cons 0 "HATCH") (cons 67 0) (cons 410 "Model") (cons 8 "SECTION-LABEL") (cons 62 255) (cons 10 (list 0.0 0.0 0.0)) (cons 210 (list 0.0 0.0 1.0)) (cons 2 "SOLID") (cons 70 1) (cons 71 0) (cons 91 1) (cons 92 1) (cons 93 8) (cons 72 1) (cons 10 pt1) (cons 11 pt2) (cons 72 1) (cons 10 pt2) (cons 11 pt3) (cons 72 1) (cons 10 pt3) (cons 11 pt4) (cons 72 1) (cons 10 pt4) (cons 11 pt5) (cons 72 1) (cons 10 pt5) (cons 11 pt6) (cons 72 1) (cons 10 pt6) (cons 11 pt7) (cons 72 1) (cons 10 pt7) (cons 11 pt8) (cons 72 1) (cons 10 pt8) (cons 11 pt1) (cons 97 0) (cons 75 0) (cons 76 1) (cons 98 1) (cons 10 (list 0.0 0.0 0.0)) (cons 450 0) (cons 451 0) (cons 460 0.0) (cons 461 0.0) (cons 452 1) (cons 462 1.0) (cons 453 2) (cons 463 0.0) (cons 63 5) (cons 421 255) (cons 463 1.0) (cons 63 7) (cons 470 "LINEAR")))
The point variables pt1, pt2....pt8 are all defined. But when I run the code the hatch is not being created? Why?
View 1 Replies
View Related
Jun 9, 2004
how to check snap errors in drawing in a specified layer against some other layer. means first layer should end with second layer otherwise place error.both layers have linear features.
View 7 Replies
View Related
Dec 24, 2013
My drawing constitutes of many blocks and other objects , and i need to find specific blocks (with same block name) in my drawing which i cannot find them one by one and i though that i can find them all with lisp routine ..
so , i wanna specify point out of my drawing area and lisp routine will draw to line from basepoint of those blocks to specify point when i select one reference block.
View 4 Replies
View Related
May 24, 2007
What would be the ideal way to find out the overlapping text.
View 9 Replies
View Related
Jun 25, 2012
I would like to get the cell with a specific name in Excel.
In Excel you can give a cell a custom name like "Project_Name".
How do I get the sheet and cell(row,column) of the cell with this custom name ?
View 6 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
Sep 22, 2011
Where I can find the DXFIN command code? I want to examine it to see how it does what it does.
View 2 Replies
View Related