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


ADVERTISEMENT

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 :: 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 :: 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 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 :: Insert Another Drawing Layout Tabs Contents In Current Drawing

Mar 7, 2013

I want to insert another drawing layout tabs contents in current drawing.

It's easy for MODEL tab, but for LAYOUT tabs, I dont know how!?

I prepared a code for INSERTING MODEL tab in current drawing:
 
(defun INS_DWG (TAB path dwg P / blk)(setq blk (strcat ""*" path dwg """));(setq N (vla-get-count (vla-get-layouts)));;Number of LAYOUT TABS in dwg(if (or(= TAB 0) (= TAB nil))(command "INSERT" blk P 1 0)); TAB=0 or omitted ==>Insert MODEL;(if (= TAB 1));==>Insert the 1st LAYOUT in dwg file;(if (= TAB 2));==>Insert the 2nd LAYOUT in dwg file;and so on....);;;usage:;;(INS_DWG 0 "c:\test\" "test.dwg" '(0 0))

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Inserting With An Align Parameter

Jul 9, 2013

Using lisp to insert a dynamic block that uses an align parameter. I have a rather elaborate lisp program that I am adding to so that it can insert one of my library blocks which contains an alignment parameter. It sure would be nice if the alignment could be automatic and not involve additional user input.

What I am hoping for would be a way to allow the alignment parameter to do its job when inserting with the following line of

(command "-insert" BLK-N-PTH ins 1 1 rot)

I was catching the rotation value of a "parent" dynamic block by using vla-get-rotation and then correcting for UCS and converting form radians to degrees, and this works well for straight blocks, but some of my blocks are curves and the whole paradigm falls apart with then.

So far my workaround is to have the user also pick the rotation, which does seem to work:

(command "-insert" BLK-N-PTH pikpt 1 1 (while (eq (logand (getvar "CmdActive") 1) 1) (command pause) ))

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Align Block With Attribute Value?

Apr 15, 2013

I started a lisp that moves blocks according to their attributes and align numeric value in x 0.0. I work currently selected point by point. I will wish it to run at once on a selection set (I am angry with entsel).

(defun c:test (/ sel ent st newpt)
(if (setq eset(ssget))
(progn

[Code]....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Align Geometry Within A Block?

Oct 5, 2011

What I am trying to do is figure out the steps to "reset" geometry within blocks. (Assuming rectilinear).

That is to say find the min X value and Y Value and align that with the 0,0 of the block. To be able to do this on a drawing full of blocks. Essentially fixing poorly defined blocks whose origins are miles/km's away!

View 9 Replies View Related

AutoCad :: Print PDF To Current Plot Settings In Current Drawing Directory

Sep 29, 2011

Is there a macro/script/deisel that will automatically print a pdf (cute pdf autocad lt 2007) to current plot settings in current drawing directory and give it the current drawing view name and number? Disk space not a problem these days and would save time to have a pdf copy of all drawing tabs readily stored in the directory ready for issue.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Merge Two Align Object Routines

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

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

Edge Animate CC :: Get Current Label In Timeline From Current Location

Jun 5, 2013

I have 1 Next button that is used on the timeline.  Each position has a pause then a play so there is only 1 button.  I need to get the label info so I know where I am so I can save the location of the timeline that the user was at if they exited before they finished the process.

View 6 Replies View Related

AutoCAD .NET :: Get Current View Name?

Oct 19, 2013

I would like to get the current AutoCAD View name in .NET.

Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.GetCurrentView().Name always returns "", even when viewing a View with a name.

View 5 Replies View Related

AutoCad :: How To Trim Current View Only

May 27, 2011

When I use trim or extend commands and have to zoom or pan to select additional objects the command drops selection in previous view and only edits items in current view when executed.

Is there a system variable I can use to change this little time waster?

View 2 Replies View Related

AutoCAD .NET :: Get Pixel Size In Current View

Oct 10, 2013

How can I get the pixel size in current view?

i.e., how many meters a pixel's width in the current view stands for

View 1 Replies View Related

AutoCAD 2010 :: How To Set Current View For Rendering

Dec 14, 2012

I'm working on a couple of models (all using the same "stage" for rendering) and I split the models up into their own separate dwgs but retaining the stage area for each. What I'm having an issue with is rendering the current view in model space. What's happening is that I'll either get an all black (meaning nothing was rendered) or I'll get a rendered piece of the stage where a model once was set up, but not the current view for which I want (where the model is set now). So basically, the rendered view is pointing somewhere else. I'm not setting any of the camera views however to render; I've been using just the current view so I can get exactly what I want. I just need to figure out "how" to get it to render what I'm seeing on screen (consistently) and not something off to the side, or a shot of the wall or floor, or the old location of previous renders, etc. Sometimes switching back to 2D wire frame will fix the problem, but now it's not. I've tried setting the camera view current and that isn't working either. It still renders what was an "old" rendered view--like it's stuck in memory. Closing and re-opening CAD doesn't fix the issue. This is very frustrating. All I'm trying to get is a WYSIWYG rendered view.

View 1 Replies View Related

AutoCAD Inventor :: Assembly Current View - Isometric Or Not

Feb 14, 2013

Is it possible to know if the assembly view is isometric view or not.I need to perform check to get this value.

View 9 Replies View Related

AutoCAD .NET :: Find Rotation Angle Of Current View

Feb 3, 2012

I'm looking to find the current rotation of my view in modelspace.

This isn't the ucs direction but any arbitrary view i'm using.

For example using 3dorbit to rotate around an object.

I want to match some temp graphics to align flat to my view.

I see there is a VIEWDIR variable. so that may be what I need.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: List Of Coordinates For View Port

Oct 17, 2011

Is it possible to obtain a list of coordinates for view ports (with dxf codes or otherwise) similar to obtaining a list of (assoc 10) for polylines?

I'm aware I can get the center, width and height from the dxf codes, but what about for clipped view ports with irregular shapes?

View 2 Replies View Related







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