AutoCAD Visual LISP / AutoLISP :: Find One Of Corners Of Viewport Outline
Feb 2, 2012
Further to my earlier topic for getting the viewport scale which has been nicely solved, I am looking for a way to get one of the corners of the viewport outline 'drawn' in modelspace so that I can add the name of the spcific layout Tab to which it relates in a location that suits the drawn outline.
The code that I am adapting came from the thread titled Outline projection all viewports to model..The routine appears to pick up the corners of the viewport in paperspace and tranform/translate them to modelspace co-ordinates.
(defun _trans (p) (cons 10 (PCS2WCS p ent))) (defun _cornersFromBBox (o / a b) (vla-getboundingbox o 'a 'b) (setq a (_trans (vlax-safearray->list a)) b (_trans (vlax-safearray->list b)) ) (list a (list (car a) (cadr a) (caddr b)) b (list (car b) (cadr b) (caddr a))) ) (if (setq ss (ssget '((0 . "VIEWPORT"))))
[code]....
View 4 Replies
ADVERTISEMENT
Dec 7, 2011
Is there a lisp for automatically draw a pline in model space of the projection of all existing paper space viewports, without need to select one by one? It will be also interesting if the lisp automatically create a specific layer like "ProjectViewport" to draw this plines. I am working with autocad 2009.
View 8 Replies
View Related
Jan 2, 2000
I'm trying to regen a viewport with Visual Lisp, with this code
(setq acadobject (vlax-get-acad-object))
(setq activedocument (vla-get-activedocument acadobject))
when I issue the next code
(vla-regen activedocument acActiveViewport )
I get the following error
*** ERROR: AutoCAD: AutoCAD is currently busy.
What is missing in my code?
View 1 Replies
View Related
Feb 2, 2012
I am adapting a routine by Alan J Thompson found here for placing an outline of a paperspace viewport in modelspace.
I have added some lines for making a suitable No plot layer with appropriate linetype, and wanted to make the lwpolyline have a thickness dependent upon the viewport scale.
My paperspace viewport scales are set for printing via Zoom - 1/50XP for example to get a 1:50 scale plot (or 0.02XP)
Having selected the relevant viewport, I wanted to be able to determine the vp scale, but am unsure how to extract this information from the viewport entity itself.
The routine was as follows:-
(defun xpfact ()
(- (car (trans '(1 0 0) 2 3))
(car (trans '(0 0 0) 2 3))
)
)
--
View 3 Replies
View Related
Aug 17, 2011
how i have to make something. In the attached file i've made a pipe/tube under a angle (see attachment). What i would like to have is that I get the outline/contour of the end of the pipe to a stretch flatten 2D model (see pdf attachment). Is this already a standard autocad command or lisp for this?
View 9 Replies
View Related
Feb 22, 2013
I'm trying to create a field in a block (titleblock) that will automaticly update when I change the viewportscale.It's mostly only 1 viewport, sometimes a second of even 3rd but, they are not important to the titleblock.
I've read aboud fields and diesel expressions. I've tried and it works. there is only 1 problem,It only works with the object (when field expresssion, object, custom scale) in this case the viewport pressent at that time.
When i use the same field with the same expressions, it does not recognize the viewport/object.Is there a way to make the field, diesel expression or even something else, work without it's need for a
object name. Perhabs that the expression gets the viewportname from a lisp, something like: (setq ss(ssget "X")) ;some thing like this Can it be done?
View 8 Replies
View Related
Nov 19, 2013
I have redined AutoCAD's copy command alias to C, but to also do other things, like set a few important variables in the background. One of the lisps I've incororated are making new viewports, that also create layers that are visibly specific to the viewport being created.
We were tasked a while ago to do an easy job of copying entities (dimensions, text and what not) in a layout. The problem is, users are copying the viewports too, which is bit more ineffificent than using the create viewport command I developed.
Is there a way to see if a selection set includes (0 . "VIEWPORT") entities? If the check returns nil, well then all is good. If the check returns "true", then I can prompt the user that a "VIEWPORT" entity is selected. I can then exit the command, or ask the user if they are sure they want to copy the "VIEWPORT" entity.
View 6 Replies
View Related
Jul 8, 2011
I have a series of drawings that are currently in modelspace. What I have to do is
1) Insert a new border in paperspace.
2) create a viewport and place the view in modelspace into it.
I am trying to use the command -vports but get an SPPROCESSQUEUE error wghen I use lists such as this:
(command -vports (list 0.625 23.59375) "" (list 35.4375 2.625) "")
View 7 Replies
View Related
Oct 18, 2013
calculation a viewport scale of 1"=30'.
I've looked around and only find nearly what I looking for. For 1"=20' I have a value of 0.004167 Paper Units = 1 Drawing Units, but what is the formula to calculate 1/30"=1'-0"?
View 7 Replies
View Related
Apr 25, 2013
I'd like to run one command that allows the user to draw a polygon viewport then sets that VP to 1/8"=1'-0".
It can be nearly accomplished with a macro, but falls just short because the polygon vp requires an unknown number of clicks, so there is no way to know how many pauses for user input in the macro.
View 6 Replies
View Related
Dec 4, 2013
I have situation where a block is inserted in paperspace before a leader is to be added into modelspace. I need it to work like the "CHSPACE" command - it pauses and asks the user to activate a viewport before continuing.
How that pause until viewport is active is done?
View 7 Replies
View Related
Mar 6, 2013
Lisp file to thaw all layers frozen in the viewport,I’m wondering if there is a lisp file that can thaw all layers frozen in the viewport.
View 4 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
May 8, 2013
I want to know the correct way to find the offset origin of a layout in an AutoCAD drawing. Let say I have a drawing that has many items on it. And I create a layout showing just the items in the lower right corner of the drawing. I want to know the offset origin of this layout relative to the Model space.
I came across some LISP commands that are supposed to do just that:
(vl-load-com)(setq activelayout (vlax-get (vla-Get-ActiveDocument (vlax-Get-Acad-Object)) 'ActiveLayout ))(setq activeplotorig (vlax-get activelayout 'PlotOrigin))
Unfortunately, the commands don't seem to work because it always returns (0.0 0.0). That cannot be right.
View 1 Replies
View Related
Jan 27, 2012
How can I find a block with a specific name and get what the coordinates are? What we have is our Bill of Material is attributed blocks. I am attempting to change the first one. Well all of the lines that list the parts are seperate blocks with the same name. Now the Top Line of the Bill of Material is a different named block. If I can find the coordinates of this block I can then select the first line to do what I need to.
If needed: AutoCAD 2013 User using Visual LISP for editing LISP and DCL files Also I have AutoCAD 2011 currently still available for us, but we are using AutoCAD 2013 for 99.9% of AutoCAD use
View 3 Replies
View Related
Jun 24, 2012
Actually I am not a Autocad Lisp person but I need to refer Autocad drawing for my workflow.
Is there a way in Lisp to find a certain, text or attribute in all files in a folder and if the file
contains that text to get the filename written to a txt file.
Config :: Intel (R) Xeon (R) CPU E31245 @ 3.30 GHz, 16.0 GB, 64bit win7
Inventor 2013 and Vault Basic 2013
View 4 Replies
View Related
Jun 11, 2007
In order to avoid duplicate text string in different places in the same drawing, I would like to have such a tool to find duplicate text string.
For instance, I want to put numbering of some connection lines, I do not want to have different lines but have same number by mistype.
View 9 Replies
View Related
Jan 25, 2012
I'm looking for a lisp routine that can find and replace multileader text.
I want to replace "T." with "T+" and "B." with "B+".
All the multileaders are on layers with a suffix of "-elev".
View 9 Replies
View Related
Jan 29, 2003
Using Lisp or VLisp, how can I find the Start & End Point of an AEC_WALL ent. ?
View 5 Replies
View Related
Feb 26, 2010
I work with polylines a lot to maintain Facility Space and I come across polylines that are overlapping. Is it possible to have a routine to find polylines that are overlapping? Sometimes I really have to zoom in pretty close to see if they are overlapping and sometimes it's pretty obvious.
View 9 Replies
View Related
Nov 18, 2013
the names of the function to establish the plotting parameters using the (vlax-get-property <name> <parameter> ) method. For example the plotting device name is obtainable by (vlax-get-property <objectname> 'Configname).
What "words"/parameters do I use to find the plot orientation and paper size?
View 9 Replies
View Related
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
View Related
Nov 27, 2013
find duplicate Text & highlight with any color (numbers or text string) ? I have a drawing and have to find duplicate text string, file is bigger and need make this automatic find, & highlight the duplicate text.
View 4 Replies
View Related
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
Jun 7, 2010
I have a “PART” block with attributes tags “PARTMARK” and “SHEAREDFROM” inserted 5 to 10 times in 10 to 50 drawings.
The “PARTMARK” value is always a unique number entered in autocad.The “SHEAREDFROM” value is calculated in Excel and exported to a “SHEARED.txt” file.
In each “PART” block I need to replace the “SHEAREDFROM” value based on the unique “PARTMARK” value, using a script that uses (or incorporates) the values from the “SHEARED.txt” file.
So far the only solution I’ve come up with is having a unique value for the “SHEAREDFROM” and –attedit to change the values in a script. However if the script doesn’t encounter a "K20-1S" in the first drawing it errors out and doesn’t proceed to the next. Below is an example of my rudimentary script.
(command "-attedit" "n" "n" "PART" "SHEAREDFROM" "K20-1S" "K20-1S" "8-60x192")
(command "-attedit" "n" "n" "PART" "SHEAREDFROM" "K20-2S" "K20-2S" "2-60x144")
(command "-attedit" "n" "n" "PART" "SHEAREDFROM" "K20-3S" "K20-3S" "2-60x132")
(command "-attedit" "n" "n" "PART" "SHEAREDFROM" "K20-4S" "K20-4S" "4-60x120")
(command "-attedit" "n" "n" "PART" "SHEAREDFROM" "K20-5S" "K20-5S" "0.7-60x120")
I’m assuming I need LISP to do this, but my LISP skills are limited. I think I would need a setq for each unique shearedfrom value (setq K20-1S (“8-60x192”))? Then somehow search each drawing for the unique shearedfrom value to replace.?
View 9 Replies
View Related
Feb 15, 2012
I have a lisp routing that the user has to use, to create a ucs, that is exactly on the front of the entity the user selects, so that whne they are drafting, labeling, dimensioningn the 3D entity, none of the drating lines are hidden when plotted.
The code is as follows:
(setq obj (vlax-ename->vla-object ent))
(vla-getboundingbox obj 'LowerCorner 'UpperCorner)
(setq LowerC (vlax-safearray->list LowerCorner))
(setq UpperC (vlax-safearray->list UpperCorner))
[code]...
Then I do a condition to see which points are greater than others, and move the ucs depending on the view to the foremost point. The program works perfectly.... however, often, they forget to use it.
I was wondering if I could incorporate it in another lisp that everyone uses, but not having the user pick the entity they want to be in front of (sometimes they pick the wrong entity). Instead, take the group of entities (anywhere between 1 to 30 per drawing (these are piping spools, so the entity count is not that great in model space)) and set a front working plane in model space. Working in paperspace is not an option, we're just too deep into our templates and processes.
I know there is a vmin and vmax, but they are for the X and Y axis, a VMax along the Z-axis would be great.
View 5 Replies
View Related