AutoCAD Visual LISP / AutoLISP :: Get Outline / Contour Of End Of Pipe To Stretch Flatten 2D Model
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
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
Mar 15, 2013
I am trying to write a simple (or at least I thought it was) code to flatten a 3d object into a 2d shape. For some reason after ACAD runs the lisp it recognizes the flatten command but it will not select all. this is what I have:
(defun c:fl () (command "flatten" "all") )
I have even tried the pick first command, to select all then run the flatten command but that still doesn't work.
View 5 Replies
View Related
Apr 17, 2012
I wanted to flatten arcs, circles and lines inside a block using the following lisp (which I found in this forum). I found that sometimes this lisp is unable to flatten the ARCs inside the blocks. I do not understand why it is not working for all the blocks. I have attached a drawing in which this lisp is not working.
(defun c:FlattenRaj ( / blocks stpt enpt inspt )
(vl-load-com)
(setq blocks
(vla-get-blocks
(vla-get-activedocument
[code].......
View 1 Replies
View Related
Jun 19, 2013
There are two lines in attached drawing. It seems FLATTEN doesn't work on them. How can I flatten them with lisp code?
View 9 Replies
View Related
Jul 21, 2006
I need a routine that one can select a fence or a path along a whole lot of contours which are not in 3DPoly but rather a heavyweight POLYLINE and then have the Z value (elevation of this polyline) printed over the contour preferably along the direction of the vertex picked.
I have something right now that works by selecting individual plines but I need one you can select a whole lot and have the text inserted at the correct position.
See my simple code below:
;THIS IS FOR LABELLING 3D CONTOURS
(defun C:3DC ()
(graphscr)
(setq p (entsel "
Select CONTOUR to label: "))
(setq e (entget (car p)))
(setq e1 (entget (entnext (cdr (assoc -1 e)))))
[code]....
View 2 Replies
View Related
Nov 21, 2013
Of course with ACAD MAP (FDO Labels for example) or better with ACAD CIVIL : no problem !
But often I have to use a Standard AutoCAD ...
A lots of people have already asked for this routine :
But I search in this forums and some others and unfortunately I can't find any correct routine Full operational on ACAD 201X 32/64 bits
I have many 2D Plines with an Elevation : some Normal , some have been splined --> 1st problem
I would like to label them with :
- either a Block with ONE attribut : the elevation
- either a MText with a blank Mask behind
As you wish ...
Question : Size/Height of the Block or MText ?
Some 2D Plines are very long (2nd problem) so I would like a question like :
Label each Pline every xxxx Units ?
So on a Pline Contour of 2000 meters, I could have the elevation (Block or MText) every 50 meters ...
Of course I would like that the Block or Mtext will have to follow (rotation) the Pline (splined or not) where the label is inserted !
View 9 Replies
View Related
Nov 30, 2010
I have a dynamic block that I would like to insert via a lisp routine. When the routine is run from my menu I would like to select two points on the drawing area. Then I would like my dynamic block to be inserted at one of the points I selected and then I would like a specific "point" of my block to be stretched to the other point that I selected. I was wondering if this is possible with LISP? I have my old LISP program I wrote that draws a leader and then inserts my block but that was before I started working with dynamic blocks.
Here is my current
(defun c:wldsym()
(setq osnapold (getvar "osmode"))
(setq orthold (getvar "orthomode"))
(setq dimsc (getvar "dimscale"))
[code]...........
wld1r.dwg is my current block. It has some dynamic properties already. But I'm trying to add new properties that can be seen in my working test drawing wld1r-new.dwg
When using my code with "wld1r.dwg" you can see how everything behaves right now. Then open "wld1r-new.dwg" and note that the insertion point and a stretch point my default are in the same spot. Work with the two stretch points and look at how the block reacts.
View 9 Replies
View Related
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
Sep 12, 2012
For those who are familiar with the Ultra-Pipe Program, when I open a drawing from Ultra-Pipethe title layer is updated by the kbupdate.lsp file and the drawing decription (title Layer) is updated with the Circuit ID and TML range. Referencing the attached pdf, you can see that this would be misleading in some cases. I need the description in the title block to be updated with the drawing name instead.
We have changed the default layer colors before in the kbupdate.lsp so I know it's not impossible. I am 99% sure that the changes needed for the problem above would be in the same file.
View 1 Replies
View Related
Aug 23, 2009
I am trying to do some minor animation with a shaded solid model. I have tried mslide and a script... this make s very jerky, flashing animation.
I tried a lisp routine to move the object in small increments, again the motion is very flashy and slow, as it appears to struggle perhaps with the shading.
I noticed doing a move command, and moving the same object manually, dragging the object around the screen with a mouse makes for pretty smooth motion. Way better than what I was doing.... Is there a way to do this programatically?
View 5 Replies
View Related
Dec 27, 2013
Here is the lisp I am attempting to use:
(defun c:ada ()(setvar "cmdecho" 0)(command "-layer" "t" "*" "on" "*" "s" "0" "f" "*" "t" "*ex_*" "t" "*all_*" "t" "rev*all*" "t" "*prop_*" "f" "*geo_*" "f" "*util_*" "t" "*grd_*" "t" "rev*grd*" "f" "*z_*" "f" "alt*" "f" "*grd_elev*" "")(command "_vplayer" "f" "*grd_elev*" "c" "t" "*grd_ada_*" "c" "" "") (setvar "cmdecho" 1))
The purpose is to show the proposed grading plan at a smaller scale so that we can give detailed grading plans to meet City Regulations per ADA codes. I understand that this can be accomplished by blocks and attributes, but when you have hundreds of spot elevations that can become cumbersome and less customizable than mtext. The large scale drawings can not have all of the spots shown or it would be too cluttered. But I want to be able to see all of my elevations when I am working in model space to ensure that all of my leaders and spots move together.
View 9 Replies
View Related
Oct 9, 2012
Any code that will select all xrefs in modelspace and bind (insert) them?
the -xref bind command requires explicit names and if I use * it will also bind my titleblock xref in paperspace which I want to avoid.
View 9 Replies
View Related
Jul 9, 2013
I have code that will set and sae a current UCS to the front of an entity, of course, depending on the viewpoint. This is so, because we need all draft lines in front of 3D solids, such as dimensions, leaders for labels, text entities and so on (the reason for not putting these entities in paper space is another discussion ).
But I'll have on of two problems on numerous occasions:
1. The user forgets all together to run the command.
2. The user will pick the wrong entity that is in the foremost position in that view.
The code I have utilizes the following:
(setq ent (car (entsel)))
(vl-load-com)
(setq obj (vlax-ename->vla-object ent))
(vla-getboundingbox obj 'LowerCorner 'UpperCorner)
(setq LowerC (vlax-safearray->list LowerCorner))
(setq UpperC (vlax-safearray->list UpperCorner))
Then I'll analyze the X, Y and Z of both the lower and upper corners, and set my UCS to whatever is proper.
Is there a "LowerCorner" and an "UpperCorner" for all entities. I can't see "VSMIN" and VSMAX" working because the elevation of the returned coordinates is always "0,0"
View 4 Replies
View Related
Jan 2, 2014
Any routine for changing color of AutoCAD background in model space. As for changing background color we have to follow four steps namely as follows:-
1. Execute OP
2. Go to display tab
3. Go to color tab
4. Change color
A tool that directly calls the model color shall be highly beneficial.
View 3 Replies
View Related
Jan 24, 2013
Is there a way by which I can link a paper space block attribute to model space block attribute
In other words
Paper space as a block Title and attribute "QTY"
Model space has a block X and attribute "QTY_MODEL"
Is it possible to edit "QTY" and as a result get automatic update on "QTY_MODEL"
I am not familiar with diesel/macros yet in Acad.
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
Feb 14, 2013
Is there a quick way to simultaneously delete all objects in a layer if these objects are found across several layout tabs and model space?
At the moment, I'm getting the objects using: (setq a (ssget "X" '((8 . "Revision"))))
This finds all objects in the drawing, but if I just use: (command "_.erase" a "")
to delete them, only the the objects in the current layout or space are getting deleted...
View 2 Replies
View Related
Jun 28, 2012
Is there a way to get model space to "display plot styles" through a lisp routine or a script?
i'm currently setting up a whole bunch of custom tool palettes for the company I work for and instead of the icons displaying in their actual colour (at the moment they're green, which doesn't show up very well on the light grey background), I'd rather they show in the plotstyle assigned to the individual dwg's.
call up the page setup manager (while in model space) and click modify, you can then check the radio button to "display plot styles" in the top-right corner. But when you have around 100 - 200 blocks to change, that process can be rather time consuming and cumbersome!
View 3 Replies
View Related
Feb 25, 2013
Without opening the drawing...
How can I iterate through and check the object type of all objects in model space? And... then delete them if they are certain types... like lines, circles, polylines, text, mtext, etc?
View 2 Replies
View Related
Nov 5, 2013
I've tried doing a block that automatically updates the X and Y coordinates from its moveable leader. I can get it to work in model space or paper space. But my problem is I want it to work in PS, but update with the MS coordinates through the viewport.
I can get it to update, by LISP, by picking a point and passing the points to the blocks attributes. At the moment I have a LISP when actioned it locks the viewports, activates the viewport, and asks you to select a point. Once selected it de-activates the viewport (going back into layout tab) then asks which block you want to update. Where you now select the block and it updates the coordinates. I.e. manually pick the point in MS, switch to PS and then manually pick the block. Then I have to manually modify the leader to the correct location.
I'm hoping that I can (In PS) move the end of the leader to snap to a position in MS and the coord updates to reflect the correct MS coordinates. I'm thinking that maybe this can't be done automatically and that I maybe can move the leader but I'm not sure how I can do it without running a LISP to update the block?
I'd be happy moving the leader then just running a single command and the leader coordinates updating without having to select the points and the block again.
I've attached the block showing the auto update of the attributes (fields).
View 9 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 14, 2013
I have a list ("temp.dwg" "temp2.dwg") and would like to add the string "insert text here" into each item in the list resulting in ("insert text heretemp.dwg" "insert textheretemp2.dwg"). how would i go about doing that using LISP?
View 2 Replies
View Related
Oct 7, 2013
Is there a way to programatically set a visual style before a drawing actually opens?
We have some huge models and people seem to forget to change their visual styles back to 2D wireframe before saving and exiting drawings. Some models will crash on some workstations when trying to open in a rendered mode.
I found a lisp with a function that looked to set viewport visual styles. But it does not seem to be supported anymore. --> (vla-put-VisualStyle vport 1)
View 9 Replies
View Related
Oct 11, 2012
I'm trying to write a lisp routine that, when I invoke the mleader command, osmode is set to "nearest" & orthomode is set off. I then would like the original settings to be returned.
attached is what I have written so far:-
View 4 Replies
View Related
Jun 20, 2013
Lisp that switches back on Selection Preview i.e. thickens and highlights lines when you hover over them?I don't know why, but they are always unticking the boxes.
View 4 Replies
View Related
Sep 7, 2012
Is it possible to execute a certain command based on multiple selections withinin a dcl? for example: two radio colums, one with selections A and B, and a second with selections 1 and 2. is it possible to program commands based on user selections from each column? ex: if A and 1- do a command. A 2- do a different command, etc...
I tried :
(action_tile "key1" "(setq A t")
(action_tile "key2" "(setq B t")
(action_tile "key3" "(setq 1 t)(done_dialog)")
(action_tile "key4" "(setq 2 t)(done_dialog)")
(if
(and (a) (1)
)
(command ...
but was unsuccessful. no matter which combination was selected, the command under all combinations would run.
View 2 Replies
View Related
Jun 3, 2013
I am trying to find a lisp that would get an attribute value (tag name = NBR_5) . I'm trying to run a simple routine that would let the user place the value from the titleblock attribute as text on a drawing. I see a ton of articles regarding getting attributes but I am not well versed in programming.
View 9 Replies
View Related
Jun 22, 2012
I have a routine that work fine, but I receive a nil at the end of command. How to fix that?
View 7 Replies
View Related
Oct 9, 2013
I'm trying to find acceptable point values to feed to the vlax-3d-point function for a vla-addmtext function. With vanilla lisp I just provide the point as x y = "7/32" "2-3/8". So I assumed that I could drop a 0 in for the z like: (VLAX-3D-POINT "7/32" "2-3/8" 0).
Then I thought I was going to be tricksy and try (vlax-3D-point (getpoint)) believing that I could pick the point and get what I need to feed the function, but yet again, no deal. The command line gave me:
node
of #<variant 8197 ...>
Nothing I can use in my code. So how do I find the point in a format that vlax-3d-point will like?
View 9 Replies
View Related
Dec 19, 2011
What is the magic word for put a point at each end of an arc, the lisp I have only put a point at center of the arc.
(defun cAA ( / i j ss e1 e2 p1 p2 p3 points )
(if (setq i -1 ss (ssget '((0 . "ARC"))))
(progn
[Code].....
View 5 Replies
View Related
Dec 30, 2011
Is there a quick way of getting the value of an attribute?
I have an attributed block called "tp_attributes" and it has and attribute called "OrderNum".
I just want to be able to quickly grab that value.
View 3 Replies
View Related