AutoCAD Visual LISP / AutoLISP :: Insert New Border - Create Viewport

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


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Create / Insert Block In Drawing

Sep 26, 2013

take a look at this piece of my LISP-routine.

(command "_.block" pause pause ss "")

where:

ss  -  is a Selection set of some entities

In the rest of code, I don't change the values of initdia, or cmdecho, or whatever else  

I haven't sill understood them that well.The problem is the following:

When My routine executes this line, I am promted for:

1. block name - that's OK

2. insertion point - that's OK

3. then the block-command receives correctly the entities from ss-selection set - that's OK

4. then all the object dissapear! **Problem here**

The block is created... I can insert it in the drawing from the block-data base...

But is there a way to let this block stay in the drawing ? without disappearing?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create Polygon Viewport At Specific Scale

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

AutoCAD Visual LISP / AutoLISP :: How To Regen Viewport

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

AutoCAD Visual LISP / AutoLISP :: How To Get Viewport Scale

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

AutoCAD Visual LISP / AutoLISP :: Odd Insert Block

Sep 26, 2013

I have a routine that counts dynamic blocks by visibility state and stores that information then prompts for scale and color and stores that information. Then a legend begins to build from the data and a collection of blocks to reflect the dynamic blocks and their visibility state. Everything works great on all of the machines around the office except on one. When the legend begins building, the one user is getting the DDATTE dialog instead of allowing the values to populate as expected. So, I had him change ATTREQ to 0 an run again. No deal, the same thing happens again and again. And; it only occurs on the one machine.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert All PDFs

Apr 9, 2012

is there a way to code inserting all pdfs in a multi-page pdf at once?

another one would be, say, you have several pdfs in your dwg that represent different aspects of the same space so you select them (they are on top of each other) and it puts them into a dynamic block automatically in different visualization states (maybe labeled 01,02,03 etc.) and you make one of the sheets visible with a drop down button.

i might be able to figure out the later if there is a way to do the former.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Xref Insert To 0,0,0

May 10, 2012

I can't seem to find the SYSVAR that controls insert to 0,0,0 instead of pick on screen..

Quad Core 2.3GHz Intel, 64-Bit, Win 7
16GB Ram, 2GB Graphics Card
256GB SSD

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert One Or Another Block Into Drawing

Apr 22, 2013

I am trying to insert one or another block into a drawing, and i need to do this 8 times per drawing. 

(defun C:detector (/ filename gas pressure)
(repeat 8 (initget 1 "Gas Pressure")
(setq filename (getkword "
Enter Detector Type [Gas/Pressure]: "))
(if (= filename "gas") (command "-insert" "*T:\acad\schematic_circuits\suny\sunygasdetectornew.dwg" pause "" "")
(or (if (= filename "pressure")
(command "-insert" "*T:\acad\schematic_circuits\suny\sunypressuretransmitternew.dwg" pause "" ""))
) ;;end or
) ;;end if
) ;;end repeat
)

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Block Into Several Drawings

Aug 2, 2013

Any way to insert a block onto many different drawings quickly? I have a title block I need to insert into about 100 drawings. It seems very tedious to open each drawing and insert 100 times.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Block At Intersection

Oct 15, 2013

I tried to adapt the code provided by scottbolton in the "Insert block at intersection" thread to suit my needs. I would like to be able to enter a block name, and let that block be inserted at intersection points.

But i keep getting a DXF error.

(defun c:sbx (/)
(vl-load-com)
;;;define block used in program
(setq bloktype (getvar "USERS5"))
(prompt "asiswaarde: ")
[code]...... 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Turn Off Explode On Insert

Oct 10, 2011

I have used Lisp and the insert command to do *blockname to explode the insertion of a block. This sets the explode check mark on the insert dialog. Once I set it on the next insert an explode occurs. I do not find away to turn it off.

Is there some trick to use that will uncheck the explode box.  I don't seem to find any system variable. I thought of inserting a dummy block without the asterisk.   I thought about trying to do a cancel somehow on insert.   

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Point At Every Block?

Apr 19, 2013

I need a routine that inserts a point at the insert point or block named "Insert_Point" at every block in the file. The routine could use the current layer, which would be set prior to starting the routine. If it could request the user for the PDMode value and PDSize that would be great too. This will assist me in creating block libraries.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Multiple Images At Once

Sep 8, 2013

How can Attach multiple images into autocad .? at a time ..!!

Any lisp available ?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Point At Block Insert Point

Sep 26, 2012

trying to insert point instead of block.

(setq blok (entget (car (entsel))))

(setq point (cdr (assoc 10 blok)))

(setq XX (rtos (car point) 2 20)) ;; x koordinata bloka

(setq YY (rtos (cadr point) 2 20)) ;; y koordinata bloka

(setq ZZ (rtos (caddr point) 2 20)) ;; z koordinata bloka

(command "point" xx,yy,zz) is not working

!xx="5582453.414999999" but when i (atoi xx) i get 5582453 no dedimals...

how to create valid insertation point from xx, yy and zz?

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Field Update Customscale Viewport

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

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 View Related

AutoCAD Visual LISP / AutoLISP :: Check To See If VIEWPORT Entities Are In Selection Set?

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

AutoCAD Visual LISP / AutoLISP :: Enclose Text And Insert Wipeout

Mar 8, 2011

Insert a rectangular frame ( on a frame layer)  round the text( which is on a text layer) with an offset whcih will then create a wipeout (on a wipeout layer using colour 255) and place it behind the text and frame layers all in the click of selecting the text.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Boundary To Title Block?

Jan 3, 2012

1. I want to all selected profiles or blocks set to one object, than continue to select second object,(see attached drawing file). How to write the "ssget" lisp.

2. Command "line" ask me specify next point.

3. Found object boundary prompt me to "select oblect", when i selected profile, with the error: bad argument type: consp.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Inserting Block With Insert Command?

Mar 27, 2012

I am working on a lisp file that lets you select a block and automaticaly change the layer and color in block editor. Afther this it exits block editor, deletes the original block and places the new one.

It works fine accept for the last part.

When i incert my new name whit the insert command it automaticaly changes the name whit autofil so it wil still pot my originial block (the new block name is only two characters shorter than the old one).

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: 2014 - Insert Block With Attributes

May 21, 2013

I am testing de new version of autocad 2014 and i have a problem with lisp.

when i use (command "_insert" "block1" pt1 "" "" "" obj1 ).

The block is inserted but without value. In the old version work.Some variable that has to change?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Insert Block On Layer That Is Frozen

Feb 19, 2013

We are using autocad 2010 and I have written a routine that will insert several blocks on to several layers.  I thought it worked flawlessly, until I used it.  Our drawings use layer states.  When one state is in use, all the other layers are frozen.  We want to insert a block, at a specific point chosen by the user, and the lisp routine will insert a couple of other blocks at that same point, but on a layer that is frozen.  Three blocks installed in all, at the same point, on two layers. The routine works if all layers are thawed, but not if the layers are frozen.

(defun c:lP1 () ; this starts the routine
(setq temperr *error*) ; saves *error*
(setq *error* rerr) ; sets the new error variable
(command "_.Undo" "_mark") ; start of "undo" command
[code]....

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Circles Along Circumference Of Cylinder

Jan 24, 2013

Am trying to put up a lisp routine to plot a couple a circles along the circumference of the cylinder(when its is develpoed flat). But the routine fails:

(defun c:cir ()
(setq rad (getreal "
Diameter of the holes: "))
(setq dia (getreal "
Cylinder diameter: "))
[Code] ........

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Mtext With Two Different Sizes Of Words

Nov 25, 2013

I looking into a way to insert mtext with two differents sizes of the words just like the image about in autolisp.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Dynamic Block Programmatically?

Feb 23, 2008

I figured out how to entmake a Block with attributes based on user input for insert point, rotation, etc.

My block is a detail bubble that is a circle with a tail, that cuts the object and shows direction of cut. I will include that with this post.

My problem lies in this. I've used dynamic block features such as linear for the tail length, and the cut length, and angle for the direction of the tail.

My old routine was simple, it would ask for detail point and angle. From that it would insert a block that was just the bubble and draw the tail and cut with a polyline.

Since then I've been able to use entmake, which is a lot more powerful for creating entities in AutoCAD. But for the life of me I can't figure out how to add the dynamic properties of my "new" detail block that has the tail, cut and bubble in one.

what I need in the entmake statement to make this create programmatically instead of inserting the block, then modifying it, if possible.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Insert Block To Points Taken From Txt File

Jun 28, 2013

I got this code in a web trawl to insert a block to points taken from a txt file......

its coming back with an error as follows:

; === Top statistic:
; Function definition (with number of arguments): ((C:INSERTBLOCKS . 0))
; Check done.

What does this mean and how can I fix it.

(defun c:insertBlocks (/ txtFile xyData expertVar attreqVar)(setq expertVar (getvar "expert"))
(setq attreqVar (getvar "attreq"))
(setvar "expert" 2)(setvar "attreq" 0)
(setq txtFile (open "c:\cad\textfile.txt" "r")) ;

[Code] ......

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Setting Option For 1"-30' Viewport Scale

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

AutoCAD Visual LISP / AutoLISP :: How To Pause For User To Activate A Viewport Before Continuing

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

AutoCAD Visual LISP / AutoLISP :: File To Thaw All Layers Frozen In Viewport

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

AutoCAD Visual LISP / AutoLISP :: Insert Block In A Specific Layout Using Function

Jan 28, 2012

I would like to insert a block in a specific layout (eg. "LAYOUT13") using the function vla-insertblock

I have already searched the web and this newsgroup but have not found the solution.

View 3 Replies View Related







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