AutoCAD Visual LISP / AutoLISP :: Draw Bounding Box At Current UCS

Oct 16, 2013

The first rectangle is drawn from 0,0 at the World Coordinate System. There is never any trouble with the code below when the objects are drawn at the WCS. The problem is when I try to draw a bounding box around an object while in another UCS. It seems that it always draws the bounding box at the WCS instead of my UCS. I have used (trans <pointlist> 0 1) on all combinations it seems and I still cannot get it to draw the bounding box at the current UCS. 

(defun c:GetFromBoundingBox (
/
*ACAD_DOCUMENT*
mspace 
pSelectedObject
lwLeft
upLeft
lwRight
upRight
[code]...

View 9 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Current View Align With Current Ucs?

Jul 20, 2013

how can i know if the current view/display is align with the current ucs?

let's say i have rotate the ucs about z axis 45 degrees and make it plan now i draw some things and then i change back to world

worlducs = 1

viewdir = 0,0,1

ucsxdir = 1,0,0

ucsydir = 0,1,0

but the display is still in the ucs z 45 (ucsfollow = 0) set the view to PLAN current (now the view is aligned) but the system vars does not change.

For a plan UCS, you would need to compare the VIEWDIR system variable and the cross product of the UCSXDIR and UCSYDIR system varaibles.

[URL]

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Check Current Plotter Name For Current Tab

Sep 3, 2013

Technique that can check the current plotter name for the current tab and assign it to a variable?  i.e. can it be assigned to a variable to check if if equals "myplotter1".  The next step  - is there a technique to change the plotter name to "myplotter2.pc3".

I have partially done the latter part of this in the past using the -plot command line to ASSIGN a  new plotter but I would really like to only run the routine if it really needs to.  

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Text With Bounding Box

Jan 13, 2012

I use the bounding box (vla-getboundingbox) to assess parameters of blocks.  These blocks have text on some of the faces that extends beyond the simple dimensions of the blocks themselves.  I'm wanting to have bounding box ignore the text and can't sort it out.  I've tried putting the text on a separate layer and turning it off and freezing it.  

 I've considered looking at sub entities and filtering out the text but I don't know if there is a solution here or not.  

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Bounding Box Of Block Definition

Nov 8, 2011

How i can calculate bounding box of a BLOCK definition ? I know after inserting a block, we can get bounding box of a block reference.

But how can i get bounding box before insert? Assuming that i never going to scale or rotate it.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Bounding Boxes Around Items With Extrusion Vector

Apr 1, 2013

I have 3d items exported from sketchup, that have extrusion vectors to them.the VLA-GETBOUNDINGBOX lisp function seems to return values from the block's coordinate system.

I need values as if there was no extrusion vector, in WCS.I am not clear on how to do this, as it seems like I want a fundamentally different box.Is there a way to recalc the box orthogonal to world coord system for each insert of the block? URL....

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select Top Block Of Column And Get Bottom Left Bounding Box Corner

Jul 10, 2013

I have blocks forming a column, and I need to allow the user to select the top block of the column but return the bottom left corner of bounding box of the bottom block in the column. 

(DEFUN NXT-INSPNT (/ BLKLST CURENT CUROBJ IDX IPNT MCMD NENT SEL SS VENT) (PROMPT "
>> Pick the Category HEADER to add note:") (SETQss nilss (SSGET ":E:S" (LIST (CONS 0 "INSERT"))) )
(IF ss (PROGN (SETQ sel (ENTGET (SSNAME ss 0)) iPnt (CDR (ASSOC 10 sel)) )
(princ iPNT) (setvar "attreq" 0) (VL-CMDF "-INSERT" "LEG-NOTE" "S" 1 iPnt 0 PAUSE)

[Code] ....

 I'm not exactly sure where my code is failing but I get the following error.

error: AutoCAD.Application: Null extents

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Geo Location And Current Sun Position

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

AutoCAD Visual LISP / AutoLISP :: Rotating A Table To Current UCS?

Sep 12, 2012

Tables do no have a rotation angle. I can find the insert point, but there is no other point to make an angle calculation with. 

(setq objTable (vlax-ename->vla-object (car (entsel))))

(vlax-dump-object objTable T)

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Registry Key For Current Profile (cprofile)

May 30, 2013

Which registry Key stores the name of the Current profile ("cprofile")?
I tried following, all reurn 'nil'

(vl-registry-read "HKEY_CURRENT_USER\Software\Autodesk\AutoCADR18.1\ACAD-9005:409\Profiles")

(vl-registry-read
"HKEY_CURRENT_USER\Software\Autodesk\AutoCADR18.1\ACAD-9005:409\Profiles\(default)")

In the registry when I double-click the key, the value is displayed. But I can't access it.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Attribute To Current Block In Drawing

Jan 22, 2013

i have a for example a block with one attribute and would like add a new attribute. i´m trying to read the current block and redefine - it comes a new attribute in propertieswindow but not graphical.

 (defun c:ent () (setq bn (getstring "
give a block name ")) (setq bez (getstring "
give a attribut name ")) (entmake (list (cons 0 "BLOCK")(list 10 0 0 0)(cons 2 bn)(cons 70 2))) (setq fe (entmakex (list (cons 0 "CIRCLE") (cons 8 "0") (cons 10 '(0 0 0)) (cons 40 1)))) (entmake (list (cons 0 "ATTDEF") (cons 8 "0") (cons 10 '(0 0 0)) (cons 11 '(0 0 0)) (cons 40 1) (cons 1 bez) (cons 3 "TOP") (cons 2 "NAME") (cons 70 0) (cons 73 0) (cons 50 0) (cons 41 1) (cons 51 0) (cons 7 "STANDARD") (cons 71 0) (cons 72 0) (cons 210 (list 0 0 1)) (cons 74 0) (cons 62 256) (cons 39 0) (cons 6 "BYLAYER"))) (entmake (list (cons 0 "ENDBLK")(cons 8 "0"))) (entdel fe) (entmake (list (cons 0 "INSERT")(cons 2 bn)(cons 10 '(0 0 0))(cons 66 1) (cons 62 256) (cons 39 0) (cons 6 "BYLAYER"))) (entmake (list (cons 0

[code]....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Rotate Block Current Annotative Scale ONLY

Dec 6, 2011

I have the below code (from a user here on the forum) which works great for aligning text, mtext and blocks to 2 points.  For annotative entities, it respects the rotation angle for mtext and text. 

ie I have an mtext object at 1"=20' scale and at 1"=40' scale.  I run the command when the current annotative scale is 1"=40'.  The object at 40' scale has changed, but the 20' scale is unchanged.  This is working as I would like it to.

But for annotative blocks, it gets weirded out.  In the above example, the block at 40' will rotate, but so will the attributes at 20' scale.  But linework and hatching at 20' scale will be unchanged.  it looks really weird. how to get it to play nice with blocks.  Ideally, I'd like the block to be at different rotation angles in different annotative scales.

(defun C:R2P (/ ss ang edata); = Rotate objects to align with 2 Points (setq ss (ssget '((0 . "*TEXT,INSERT"))) ang (angle (getpoint "
First alignment point: ") (getpoint "
Second alignment point: ")) ) (repeat (sslength ss) (setq edata (entget (ssname ss 0))) (entmod (subst (cons 50 ang) (assoc 50 edata) edata)) (ssdel (ssname ss 0) ss) ))

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Excel Macro To Zoom To Object In Current DWG?

Jun 14, 2013

I am looking for an example excel macro to zoom to an object given the obect entities handle.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Open Windows Folder Of Current Drawing?

Jun 5, 2013

How to create lisp which i can simply type in to the command bar so that the current drawing's filepath-folder will be automatically opened by windows explorer?

running AutoCAD 2012 / Windows 7...

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Modify Dim Text Color In Current Dimstyle

Jun 27, 2012

How to change the dim text color in current dimstyle with a lisp routine? I want to modify current dimstyle instead of override current dimstyle, so it can change all existing dim text color under the current dimstyle.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Vlide Configure Current Window Error

Aug 17, 2011

I have a problem with  "tools/window attributes/configure current"when I try to configure current window (especialy tabulator spaces 8 -> 2) I got fatal error: unhandled access violation Writing 0x0000 Exception at cc424946h

Windows 7 (x64)

AutoCAD 2009, 2010, 2011, 2012

standalone instalation

user with administrator privileges

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Make Page Setup Current And Active

Sep 9, 2011

We are using this code for Page setup. But We don,t know how to make this page setup current and active.

(defun c:pgs ()(acet-error-init(list(list"cmdecho"0"osmode" 0)T))(vl-load-com)(setvar "Tilemode" 0)(vla-Add (vla-get-PlotConfigurations (vla-get-ActiveDocument (vlax-get-acad-object))) "A1" :vlax-false)(vla-put-PageSetupOverridesTemplateFile (vla-get-files (vla-get-preferences (vlax-get-acad-object))) "A1")(setq item (vla-Item (vla-get-PlotConfigurations (vla-get-ActiveDocument
[code]........

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Retrieving Current Paper Text Height

Oct 10, 2012

I'm looking for code to retrieve the "Paper Text Height" from the current (active) "Text Style".

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Cannoscale Applies The Current Annoscale To All Objects

Mar 31, 2013

cannoscale applies the current annoscale to all objecs...i would like to apply it to specific objects? 

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Suppress Mtext Command Current Text Style / Prompt

Nov 3, 2011

I'm running the following string in a routing that is looping so I get dozens of these prompts. How to supress these?  Or, do i have to use to entmake?

(begin loop...
(command ".-Mtext" CSW-Tpoint "W" 0.0 (vl-filename-base (vla-get-imagefile image)) "")
);end loop

Prints to the command line..

Current text style:  "Standard"  Text height:  0.0833  Annotative:  No
Current text style:  "Standard"  Text height:  0.0833  Annotative:  No
Current text style:  "Standard"  Text height:  0.0833  Annotative:  No
Current text style:  "Standard"  Text height:  0.0833  Annotative:  No

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Draw Line In A Layer

Jun 5, 2013

How do I select the layer in which I want to draw?

for example i draw two line and Each of them has to be in different layer.

How do I select the layer  which I want to draw?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Polyline With Clipping Outside

Mar 7, 2012

is there a way to draw a polyline and have autocad clip everything outside of that polyline and discard it so that i end up with a smaller drawing.  only the information in that polyline, nothing outside of the polyline

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Draw Text Entity In 3D

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

AutoCAD Visual LISP / AutoLISP :: Draw Rectangle Dimension?

Apr 17, 2013

how I would go about writing a function that would calculate the length of a diagonal of a rectangle using SQRT function? I've been trying but so far nothing!

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Draw Triple Or More Lines

May 8, 2013

Lisp code here for draw for example triple parallel line ? each line will be own layer and color..

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw All Objects At Same Time?

Sep 24, 2012

I have made a lisp routine to draw lines on polyline. And here are a lot of lines on it. So using comand

"(command "line" pt1 pt2 " ")"

takes a lot of time. Is here a way to creat lines in memory or similar and only then draw them all on screen?

I have search but coudin't find any info. I do not know how to formulate a query.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Unable To Draw A Line

Sep 18, 2013

I've written my first little Lisp function.What it's for is drawing a simple borehole profile that can then be used to draw stylized cross sections on top of it.

Upon start the lisp, pick a point on screen (to get the X coordinate [x1 below]), then enter ground level at the command line [g1 below], then enter as many thicknesses as are present in the borehole log (will vary, but typically between 3-12). These I added to a list, because that seemed to make sense when I did it.

What I want it to do then is draw a pline from x1, g1 down to the next point (x1,g1 minus the 1st thickness), then the next (x1,g1 minus the 2nd thickness) etc., to the bottom of the borehole.

Then my CAD guys can sit there, and using the borehole logs, enter the values of the boreholes and it draws them on the screen, making it easy to join th dots.

It might be good if it placed a Acad point at each point as well, but I'm not overly bothered about that at the minute.

Here's my attempt so far.

(prompt "Type 'e1' to run...")
(defun c:e1 ( / )
(command "graphscr") (setq x1 (getpoint "
Pick insertion point:")) (setq x1a (car x1))
(initget (+ 1 2 4))   (setq g1 (getreal "
Enter ground elevation: "))
(initget (+ 1 2 2)) (setq lvllist nil )   (while   (setq lvl (getreal "
Enter layer thickness <Exit>: "))   (setq lvlList (append lvllist (list lvl))) )
(princ) )

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Square By Area

Nov 27, 2013

I would like to be able to draw squares by the area they should have. So that if I need a square of 50m2 autocad automatically draws a square of sqrt(50) x sqrt(50)

Because right now I have to draw 200 squares with 100 different areas and I have to calculate and manually draw each one of them.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Draw Polyline Between Two Blocks Of Same Name

Nov 13, 2013

i need a vlisp program to draw polyline between two blocks.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract Attribute Tag Value And Draw Polyline

Apr 25, 2012

I have a inserted block with 4 tags for Length, Thickness, Elevation and Width.How can extract attributes tag values and draw a closed polyline + 2 internal lines, parallel to the block?

Block Name: ID_DATA
Tags: LEN, THI, ELE and WID.

Each internal line placed in a third width.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Code To Draw Grid Lines

Jan 1, 2014

I have this code to draw grid lines within a rectangle:
 
;Variable settings(defun var_set () (setq *var_lst* '("cmdecho" "osmode" "expert" "plinewid" "dynmode") *var_usr* (mapcar 'getvar *var_lst*)) (mapcar 'setvar *var_lst* '(0 0 2 0 0)) (vl-load-com))(defun var_reset ()(mapcar 'setvar *var_lst* *var_usr*)) (defun *error* (msg) (if (not (member msg '("console break" "Function cancelled" "quit / exit abort" "" nil)) ) (princ (strcat "
Error: " msg)) ) (and ;(vl-bt) (var_reset) ) (princ) ) (defun string-list (data) ;by lee-mac @theswamp (if (vl-string-search "@" [code].........

The above gets me the grid lines; but I have a block inserted at both ends of the grid line; how do I get the selection of those entities (selection set "frame") after each array?

or I would need to map a point list and draw each grid individually how do I go about that?

Attached is the sample of the output I'd like to achieve using LISP.

View 3 Replies View Related







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