AutoCAD Visual LISP / AutoLISP :: Larger Routine To Create And Rotate Text Based On Object Selected
Dec 29, 2011
the expression in question is part of larger lisp routine to create and rotate text based on the object selected and the viewtwist variable (we use dview twist to rotate our views when needed)
So the expression in question:
(< (/ pi 2) ang (* pi 1.5)
where ang is the total angle used to determine proper rotation of the text.
Now the problem. In most cases where ang = 90 (or 1.5708 radians) this works fine. the two exceptions i have encountered
in testing are a line at 70 degress, viewtwist 20, and line at 50, viewtwist 40. For whatever reason at these two conditions the expressoin evaulates True instead of nil and rotates the entire text object incorrectly (180 degrees). So question is how exactly is this being evaluated? i know its comparing ang (* pi 1.5) to (/ pi 2). is there some sort of rounding error? or maybe the expression needs a wee bit more definition? attached image and full lisp routine for reference of what is happening, blue text is angle of the line as created by routine at viewtwist 0.
View 1 Replies
ADVERTISEMENT
Sep 18, 2013
I was wondering if there is a setting somewhere that could hold my snapmode settings after I use a lisp routine. I found a lisp routine to rotate text and have noticed that everytime I use that lisp command I lose my osnap settings....
View 2 Replies
View Related
Jun 2, 2004
lisp routine that will add together the values of text entities? For instance, if I have a big parking lot and each section is labeled with the number of spaces, I could pick the texts and it would add all the numbers together to give me a total. Right now I export to excel to do this. I have quite a few situations where this would be handy, not just for parking spaces, so I really just want a lisp that will add all my selected numbers.
View 9 Replies
View Related
Dec 19, 2012
make a LISP that will work with my room dimensioning? I'd like to be able to specify the width and depth of the room using a command similar to the "dist" command, and then click a point to place a text based on the distances gathered. I'd also like the text to be formated into architectural units and displayed like this: 12'-0" X 13'-5". Also, if possible, round the result to the nearest inch (to avoid 1/2" and 1/4" dimensions).
View 9 Replies
View Related
Jun 19, 2012
I was interested in finding out if it's possible to write a LISP routine that would execute a pop-up dialog box say every 30 minutes. This is strictly for ergonomic reasons to remind the user to take a pre-determined break.
I am not an expert code writer by any means, but I imagine the routine would autoload and resetting the timer to 0 upon opening a particular drawing file. The LISP routine would then run in the background and run the (alert "") command when the timer reaches 30m 0s. When the user presses the OK button, the timer resets to 0 again.
View 9 Replies
View Related
Jul 3, 2012
" Convertion of AUTOLISP base routines to Diesel MACRO based routine to be used in a AUTOCAD LT based platform "
Here i am attaching the lisp file for ready reference.
View 1 Replies
View Related
Jun 13, 2013
I am looking for a way to extract (filter) all polylines, and loop a lisp based on the number that are found within a "W" selection window.I am frustrated getting "malformed list" or errors, even after defining "n" for repeat.The code I have so far looks like this:
(defun cWW (/ p1 p2 sspw myObj ss)
(setq p1 (getpoint "
Pick first corner: "))
(setq p2 (getcorner p1 "
Specify opposite corner: "))
(if
(setq sspw (ssget "W" p1 p2 '((0 . "*POLYLINE")))
[code].....
Without the (repeat () portion, it was working ok with selection window, however it only would run the commands for a single polyline. What needs to be done without overhauling the code? The lisp has worked on a drawing-wide basis, however needs to run on only on user-windowed polylines since there are other polylines within the drawing which are attached to layouts via viewports.
View 9 Replies
View Related
Apr 5, 2013
Create a routine that looks for a block based on a portion of that block name, using a specified path or search path.
For example, block to search for is BLOCKABC123, so if someone inputs ABC or 123 as a block name, it will locate that block within that folder and inserts it into the drawing at a user specified location.
Ideally, if there is a check in that if it finds more than one match, then perhaps it flags or prompts you to choose 1, 2, or 3 option which block to use. But I can live without this special function if it requires too much time to code.
View 8 Replies
View Related
Jun 20, 2011
A lot of the LISP routines we use turn off all snaps except the "nearest" snap when the routine is complete.
I draw with 6 out of the 10 snaps on (not the nearest).
LISP routine that loads specific object snaps?
View 9 Replies
View Related
Jul 21, 2003
Is there a lisp routine to draw 3D object by the LOFT way ? .
View 4 Replies
View Related
Apr 9, 2012
For a program i am working for i have to extract the base point of a dynamic block.
This can be done perfectly by this function:
(cdr (assoc 10 (entget (car (entsel)))))
But i want the entity selected based on a previous slected point. So for example when i selected pt1 (which is a point at the border of the dynamic block) i want to be able to extract the base point on the block whit this point.
View 8 Replies
View Related
Dec 27, 2013
I have a CAD file with a couple hundred detail blocks in it, and I am trying to standardize them without haing to block edit each detail block.
What i am trying to do in each block is as follows:
- Explode all dimensions, leaders, and blocks
- Change all objects to layer "0"
- Change all lineweights to default
- Change all object on colors 7 and bylayer to byblock
- Change all text and mtext to arial font
- Delete all points
Civil 3D x64 2012
Win 7 x64 Ultimate
I7 3820 (3.6ghz quad core with HT)
32gig RAM (Corsair XMS3 4x8g)
Intel x z79 mobo (BOXDX79TO 2011 socket)
Radeon HD 7850 2gb GDDR5
View 3 Replies
View Related
Oct 3, 2011
I am looking for a lisp routine that, when activated, asks the user to select the "preset view" (similar to the preset view command found in the ribbon, but instead smaller and quicker), enter name for the view, end.
If possible, perhaps a command, relating to the routine above, that can be placed in the short-cut menu (right-click), which will list the preset views (made by the user), and be selectable.
The approach is instant view change, where it is possible to apply the command, then reapply to go to another view.
if possible, surely there'd be some people that may be interested in this capability.
View 1 Replies
View Related
Jan 8, 2014
Any Lisp Routine to scale text objects a certain value and have the program actually scale each text object as you pick them.
The change text height using the Properties function does not work for what I need because the objects I need to scale are Mtext objects with Background Mask, and when you use the Properties function to change their text height it messes up the background mask so that you have to select each text entity and stretch the mask area smaller or larger, but if you use the scale function it scales the background mask as well so the background mask coverage is still the same.
View 2 Replies
View Related
Aug 17, 2012
i found this valuable script Lisp routine to insert blocks at point locations and want to modify it but i do not know much about lisp ...
what i want is :
1) script start and asks for a Block Name (in this case QPP1, QPP2, QS, QE, ect)
2) the user picks existing text
3) the script reads the value existing on this text an put it in a variable
4) then erases the pre picked text
5) inserts the block chosen
6) changes block value to number value pre-read
since it do almost all steps except for step 3 and 6
View 4 Replies
View Related
Aug 7, 2013
Using Nentsel function, I can get info on a object that is nested with an Xref. Is there a way to move the selected object using ObjectDBX?
View 9 Replies
View Related
Jun 3, 2013
How to make a lisp command that will select all objects in the drawing?
View 3 Replies
View Related
Sep 9, 2011
I thought this would be a simple tblsearch process, but as far as I can tell, there isn't a tblsearch symbol table for vplayer settings, so I need to get more creative I guess.
I want to be able to get the vplayer color of a selected object as part of a larger routine I'm putting together.
View 8 Replies
View Related
Aug 15, 2013
I think there is a function that will cause the selected object that is in the XRef to highlight.
View 1 Replies
View Related
Jul 29, 2013
When i export revit drawing with revit family
the revit family become block in autocad like this
M_Single-Flush - 700 x 2200mm-278353-Ground Level _0_45
usually i want to remove the ID and view name to become like this without have to re type because it is tedious
M_Single-Flush - 700 x 2200mm
something like how many letters you want to remove from last to first ?
or something better like remove this last two dash and the letters embedded inside ( that separate name-ID-View name) -278353-Ground Level _0_45?
View 9 Replies
View Related
Mar 1, 2012
Is there a way to determine the type of ACAD object that the user selected? I need to retrieve the value from either a dimension or text. The info could be in either format so the lisp routine needs to determine what was selected so the correct vla-get command is used.
Once I determine what the object is I can use an if statement to retrieve the value.
;user selects the object
(setq dimobj (vlax-ename->vla-object(car(entsel))))
;If ACAD object is a dimension do this.
(setq dimvalue (vla-get-textoverride dimobj))
;If ACAD object is text do this.
(setq dimvalue (vla-get-textstring dimobj))
View 4 Replies
View Related
Jan 4, 2014
I need a lisp file that can read the total length of selected object (lignes, polylines) and summarize them by layers or by color in a table
e.g
command:tl (total length)
select objects
found total length.......
select object (Ent)
total length or [Add/Subtract/Table] :
total length = .......
if table
Enter an option by [ Layer/Color/line Type/line Weight] <layer> :
View 4 Replies
View Related
Jun 10, 2010
I would like to use the entmod method to rotate the text in a Multileader object. Reading the DXF code tells me the dotted pair of 42 seems to be the rotation angle, but entmoding that does nothing. Obviously I don't know how to modify this complex object.
View 3 Replies
View Related
Nov 14, 2012
I need a LISP program that prompts: "select text(s)" then I select for example 100 text in open drawing file.
after that this program creat a file (LIST.CSV) and write each selected text in line by line of this file:
result text file (LIST.CSV ) should be:
Text1
Text2
Text3
...
...
Text99
Text100
ofcourse Text1 is the content of a text object.
View 9 Replies
View Related
Oct 25, 2012
A program that prompts:"select objects:" then I can select some objects like as text, line, circle,... after that program find all texts in selected items and swap text
swap means: xxx/yyy ===> yyy/xxx ; "/" is a divisor
swap function for one text is here:
(defun c:swap ( / pos ent el txt)
(vl-load-com)
(if(null #div#)(setq #div# "/"))
(setq #div#
(if(=(setq tmp(getstring(strcat "
Divisor character: <"#div#"> ")))"")
#div# tmp
)
[Code]....
but I want a program to prompt me like this:
(prompt "Select objects:")(terpri)
(setq a (ssget '((0 . "TEXT"))))
and gets divisor char </>:
after that:
(setq n (sslength a))
(repeat n
....
)
repeats n times, n=number of texts in my selection
View 6 Replies
View Related
Nov 13, 2012
I’m trying to put together a loop for if nil or something other than text or mtext is accidentally selected than prompt text was not selected. This is what I have so far.
text or mtext is not selected than prompt
(defun C:ww ()
(while
(not
(and
(setq esel (entsel "
[Code]......
View 7 Replies
View Related
Jan 17, 2013
I have a little routine to add two selected numerical texts together and show the result at a selected position. I am using the entsel method to select them. I would like a way to highlight the selected text temporarily. Is this possible. The routine is as follows.
(defun c:T+ ( / Txt1 Txt2 Txt3 Pkt )
;Adds second selected number to first
(setvar "dimzin" 3)
(setq curlay (getvar "clayer"))
(setq curcol (getvar "cecolor"))
(setq curlin (getvar "celtype"))
(setq ds (getvar "dimscale"))
[code]....
View 3 Replies
View Related
Jan 24, 2013
I need a LISP program to add a text given by user to all selected text.
in other words:
1- user selects some texts.
2- user give a text to program.
3- Program added this text to all selected text.
selected text: text1, text2, text3,text4,....,textn
given text by user: _xyz
Result:
text1_xyz, text2_xyz, text3_xyz,text4_xyz,....,textn_xyz
View 6 Replies
View Related
Feb 2, 2013
I need a program to trim selected text(s) with a divisor.
suppose that the divisor character is: "/"
(selected text==>result
textL/textR ==> textR
xxx/yyy ==>yyy
t12x/5678 ==>5678
I should use some commands like:
;;;;div="/":
(setq str "xxx/yyy")
(setq pos (vl-string-position (ascii "/") str))
(setq len (strlen str))
(setq RGT (substr str (+ pos 2) (-(- len pos)1))) ;;=text after "/"
but I need a LISP program that:
1-ask user to give a divisor char: (Divisor character: </>)
2-ask user to select text(s) but program should filter selected text(s) with divisor (*/* pattern)
(if (null #div#)(setq #div# "/"))
(if (and
(setq #div# if (= (setq tmp (getstring (strcat "
Divisor character: <" #div# "> ") ) ) "" ) #div# tmp ) )
(setq ss (ssget "_:L" (list '(0 . "*TEXT") (cons 1 (strcat "*" #div# "*")))))
)
View 5 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
Apr 5, 2013
I have very little knowledge in complex Autolist routines and routine to do the following:
I would like to be able to provide a Prefix and/or Suffix via dialog then pick any line of text or multiple lines of text and have it concentrate. For example: Prefix: First Floor Suffix: M100. I pick the room text on an arch floor plan "Mechanical room" and the second line "100" The result will be "First Floor Mechanical room 100 M100".
But lets take it a final step further; once condensed, I want it added to a perticular tag attribute in a block I inserted.
Example of how I would use it. I insert a symbol for an addressable smoke detector that has several tags; one of them being Location. I would use this routine to gather the information provided by the Arch floor plan and join it with the block attribute for exporting later for use in the Fire Alarm Panel Programming.
attached is a sample block with the attributes.
View 9 Replies
View Related