All Activity
- Past hour
-
seo peoung joined the community
- Today
-
mhupp started following Room dimension lisp
-
And easy midpoint of two points add them up and divide x y and z by 2 (setq mpt (mapcar '/ (mapcar '+ pt1 pt2) '(2 2 2)))
-
Struggle Replacing text in MText object with string in a variable, no prompt ideally
Kreaten_vhar replied to Kreaten_vhar's topic in AutoLISP, Visual LISP & DCL
Thank you very much! I'm making some headway into this problem now. Couldn't find vla-put-textstring in my reference material, and that's very much useful here! Going to keep reading into entmod and things of that nature to try and get more comfortable with messing with the DB to go along with Steven P's suggestion. You all never disappoint -
Struggle Replacing text in MText object with string in a variable, no prompt ideally
exceed replied to Kreaten_vhar's topic in AutoLISP, Visual LISP & DCL
If you just want to put something in text or mtext, case1. your text is object (vla-put-textstring your_text_obj your_text_string) case2. your text is ename (vla-put-textstring (vlax-ename->vla-object your_text_ename) your_text_string) The link is the code I recently used vla-put-textstring. This is the code to paste the text copied to the clipboard into the existed text in drawing. maybe this code has little relevance, but there is how to put something in the text -
ronjonp started following LISP program that automatically put a copied nested block into a new generated subsequent Layer and Room dimension lisp
-
@Steven P You can also subtract the X's and the Y's to get W and H. (and (setq p1 (getpoint)) (setq p2 (getcorner p1)) (setq r (mapcar 'abs (mapcar '- p1 p2))) (mapcar 'print r) )
-
LISP program that automatically put a copied nested block into a new generated subsequent Layer
ronjonp replied to MannyM's topic in AutoLISP, Visual LISP & DCL
Precisely .. quick example for OP: (if (setq e (car (nentsel))) (progn (vla-put-color (vlax-ename->vla-object e) 3) (command "_.regen")) ) -
Struggle Replacing text in MText object with string in a variable, no prompt ideally
Kreaten_vhar replied to Kreaten_vhar's topic in AutoLISP, Visual LISP & DCL
Howdy @mhupp, thanks for taking some time to respond. I'm essentially taking a file index template and comparing it against a project folder which can have anywhere from ~6-17 drawings. So I'm iterating through the dwg files in the folder to check what files are actually present or not. Then for what's not there, I want to delete the portions of the text contained within the mtext object that mention the drawings that are not present. Though all that is "done" (at least in memory) I've just been struggling getting the new stuff into the mtext object. I feel like I'm probably diving a bit too deep into all this for having around a month of LISP programming (and dare I say only a month of coding experience in general xD) Sink or swim time baby! And yeah, I do apologize about not posting code, but there's semi-sensitive info there -
Struggle Replacing text in MText object with string in a variable, no prompt ideally
Steven P replied to Kreaten_vhar's topic in AutoLISP, Visual LISP & DCL
Love it when a small hint sets you on your way again, if you need anything more just shout out. -
mhupp started following Struggle Replacing text in MText object with string in a variable, no prompt ideally
-
Struggle Replacing text in MText object with string in a variable, no prompt ideally
mhupp replied to Kreaten_vhar's topic in AutoLISP, Visual LISP & DCL
Some times i tend to over think things playing devil's advocate here asking a stupid question. But why are you comparing it against another string that exists in a variable and not just overwrite it with the variable string cutting out the middle man? like exceed said a example drawing or code would help narrow down what you want to do. -
Struggle Replacing text in MText object with string in a variable, no prompt ideally
Kreaten_vhar replied to Kreaten_vhar's topic in AutoLISP, Visual LISP & DCL
@Steven P Thanks for taking the time respond, I seem to be on the right track now with entupd and similar functions, thank you so much! @exceed Thank you as well! Right now the issue is taking the text we've already edited and dumping it back on the drawing. Also I didn't want to post any code because it's loaded with propriety info as is, sorry about that >.< Thank you for the tip about running commands without the dialog box, those commandline tricks always evade me lol As always, y'all on here are legends! -
Struggle Replacing text in MText object with string in a variable, no prompt ideally
exceed replied to Kreaten_vhar's topic in AutoLISP, Visual LISP & DCL
I can't be sure if I understand correctly because there is no example code or drawing, Selecting text from the entire drawing without user selection (ssget "X" '((0 . "*TEXT))) ends with this one line. Changing text is sometimes convenient with (vl-string-translate ~~) To execute a command without a dialog box, add - in front of the command. -
Steven P started following Struggle Replacing text in MText object with string in a variable, no prompt ideally
-
Struggle Replacing text in MText object with string in a variable, no prompt ideally
Steven P replied to Kreaten_vhar's topic in AutoLISP, Visual LISP & DCL
If you have selected Big Ol String then that should be accessible to replace later as an entity After that you might look at ent update to replace the text with its new text. Should be that you update dxf code '1' How big is the Big Ol String by the way? If it is very big ol string or massive ol string you might find that the text is split between a couple of dxf codes, you'll have to delete these before you put your new text into dxf 1. If I get chance I have this somewhere and can dig it out later, and if not might give you a clue where to look -
SEANT, yes, even though it's not clearly visible. This total assembly is made up of 3 pieces which spans over 82 feet. And the radii change several times between the bottom and the centerline of it. It's symmetrical so that means I only need to get one side of it and then mirror it. The layout did work when I put is on top of the rolled tube. So we're proceeding with fabrication.
-
Struggle Replacing text in MText object with string in a variable, no prompt ideally
Kreaten_vhar posted a topic in AutoLISP, Visual LISP & DCL
Good morning, afternoon, evening everyone. I've hit yet another snag in my efforts to code some useful lisp programs. The functionality of the code is to rip a big ol' string from an mtext object, compare it against another string that exists in a variable, then edit the big ol' string to remove any lines of text that doesn't have a equivalent. Once the big ol' string has been edited I want to replace all the original text in the mtext object with our new string. As is I have managed to do all the comparisons and edit the big ol' string in memory, but replacing the old text in the mtext object with my new string confounds me I've searched around to see if there were any functions the generous peeps of this community, and found some promising code from Lee Mac, his batch find function, As well as other functions, but they all seem to involve popping up a dialog box and selecting objects. I also figure the FIND command could do it, but it also prompts the user to select an object and type a string but all that information is sitting in memory already, seems like a waste of user time. I don't want a dialog box Any recommendations? -
mhupp started following LISP program that automatically put a copied nested block into a new generated subsequent Layer
-
LISP program that automatically put a copied nested block into a new generated subsequent Layer
mhupp replied to MannyM's topic in AutoLISP, Visual LISP & DCL
That's not how blocks work. you can have a dynamic block that changes shape or attributes that can change. but once you start changing the layer or other core proprieties that affect goes to all blocks sharing that name. you would essentially have to explode and remake the block and all nested blocks under a different name and then join them back in the same order. -
PURUSHOTTAM joined the community
-
No problem,
-
Wow this works. thank u very much. saves lot of time.
-
SOLVED? Structures not showing up in profile
CyberAngel replied to CyberAngel's topic in Civil 3D & LDD
It's two weeks later, and the same problem came back. I tried restoring the pipe catalog files again, but that didn't work. What did work was the nuclear option. I wrote down the inverts for each box. In turn I disconnected the pipes from each box, deleted each box, created a new box, adjusted the plan label, reconnected the pipes, and redefined the inverts. Then I toggled the Draw button for each box in the profile view. Finally I added a profile label for each box. And if the problem comes back again, I'll have to re-create all the structures again. Thanks to the users on some other board who suggested this fix. The only reason I can see for this issue is a faulty audit, or a corruption that affected a subsequent audit. This doesn't happen in every drawing. I noticed an audit had removed a number of aecdb* blocks. Since the structures remained on the plan, it must have been the instances of those structures on the profile that broke. Why Civil 3D can't recover from an error that it created itself is a mystery. -
OK So it you might have made something like this if you got it to work: (defun c:testthis ( / spt1 spt2 roomname a b c d scpt1 mywidth myheight) ;; after the '/' are local variable names (setq ;;setq: Tells LISP you are setting a variable spt1 (getpoint "\nPick the first point") ;;should be obvious what this does spt3 (getcorner "\nPick the next corner" spt1) ;;should be obvious what this does roomname (getstring "\nEnter Room Name: " T) ;;T allows spaces, else space acts as a return a (if (< (car spt1)(car spt3))(car spt1)(car spt3)) ;;Lower Left X coord car gives first item in a list, here x coord b (if (> (car spt1)(car spt3))(car spt1)(car spt3)) ;;Upper Right X coord c (if (< (cadr spt1)(cadr spt3))(cadr spt1)(cadr spt3)) ;;Lower Left y Coord cadr gives second item in a list, here y coord d (if (> (cadr spt1)(cadr spt3))(cadr spt1)(cadr spt3)) ;;Upper Right Y Coord ) (setq mywidth (abs (- a b))) ;;abs for absolute value (witohut = or -), (- is subtract (setq myheight (abs (- c d))) ;;center points (setq scpt1 (list (/ (+ a b) 2) (/ (+ c d) 2)) ) ;;create a coordinate which is a list (/ for divide (+ for add (command "mtext" scpt1 "J" "MC" scpt1 (strcat roomname "\n" (rtos mywidth 2 2) " x " (rtos myheight 2 2 )) "") ;;Command echos what you'd type in command line, anything in "" is a fixed value in else it is calculated ) Put a few notes in if you want to learn how it does what it does
-
Research the topic "rendering architectural drawings".
- 1 reply
-
- 1
-
-
Layout from model space multilayer files
mhupp replied to itacad's topic in AutoLISP, Visual LISP & DCL
Yeah I saw that Steven but they way they have their layers named the list would show up as 1, 10 - 19, 2, 20 - 29, 3 Was thinking about that. if they need it to do something like that ill update the code. -edit- Also had vplayer to turn off all layers but it was late and took it out. that's why their is lst2str in there. converting ("01" "02 ..." to "01,02..." I guess you could add it back in before mspace. was misunderstanding what All meant in the options it means all viewports on the current tab not drawing. (vl-cmdf "_.vplayer" "f" (lst2str "," layer) "all" "" "") -
Create your Mtext with contents with respect to alignments Middle Center if required then move it via specifying the two points diagonally.
-
is it possible to draw point in an intersection between lines of 2 designated layers?
aridzv replied to aridzv's topic in AutoLISP, Visual LISP & DCL
Hi. here is the final updated lisp. the major change is that the 2 layers are not hard-codded in the lisp,but the lisp prompt the user to select them. thanks again for all the help, Ari. cdnc5-02_6.lsp -
Tharwat started following Lisp to connect polylines to centre or centroid of blocks
-
Lisp to connect polylines to centre or centroid of blocks
Tharwat replied to cadggnore's topic in AutoLISP, Visual LISP & DCL
Its quite with many codes to cover the process correctly, would like to write it for you but I need a few encouragements. -
Thanks for the reply Stevan P. not able to get the rest of it. tried. please help
-
nicolas started following Colored Plans
-
Hi, Would like to engage in discussion regarding colored plans esoecially architectural items. Is there some codes or guidelines or purely from experience tutorials, hints and tips on coloring the usual black ink plans? I am looking for the best color to enhance architectural items like common masonry units Walls, columns, kitchen table, sanitary wares, ceramic tiles, timber floowing, bed, furniture (dining tables, chairs, stools, cabinets), appliances (fridge, oven, range above (shown with hidden lines), human beings, plants, sink etc. Then we have the openings mostly Aluminium, Glazing and Timber Doors. and the railing. Your experience and input will greatly benefit me and others. Thanks.