Leaderboard
Popular Content
Showing content with the highest reputation since 12/12/2024 in all areas
-
5 points
-
Get smaller fingers so you don't hit them by accident? Look at an internet search: 'AutoCAD mapping F keys"3 points
-
now you tell me I like this quote : “Life is not obliged to give us what we expect.” Sure , some users don't respond or don't give a like but unlike some users , I don't feel the need to respond to every thread or want to collect as many likes as I can for the sake of reputation points. Most of us are here just to give a helping hand to those who ask for it and expecting eternal glory or whatever only leads to disappointment. Having said this , I am gratefull for everybody who liked my post. It does give a feeling of appreciation. Even when OP is a No Show , others may still find your response useful. So when you do deal with a 'leacher' , just append his folder with "_No_Show" so next time you feel the urge to respond you can lower your expection for ever getting a response.3 points
-
I'm put it because i didn't know what all is in the drawing (for e.g. multiple "blll" blocks in different layers, and to avoid selecting those which are not on polylines...), but after all, it is unnecessary for the selection filter. Thank you for suggestion . P.S. Your code was much better than my, concise and with a lot good skills. Best regards.2 points
-
Is the (arxload "acetutil.arx") working in your image ARXLOAD failed, you may need a full path use "\\" between directories. Just find acetutil.arx with explorer. Look Program files\Autodesk. Accoreconsole may not support acet functions. It does have limitations. If you can not get past the load will need to use maybe OBDX or an old fashioned script. Make sure with all testing you use a dummy directory of copied files.2 points
-
2012年的发的文章,时隔13年居然依旧是互联网上延曲线填充唯一的解决方案,谢谢!伟大无需多言。 现在已经是2025年了,应该不用我翻译成英文回帖子了 表达一下感谢2 points
-
Thanks everyone for the replies I understand that importing external DWG files with Entmake is very difficult, maybe not even possible. Many people (like you @pkenewell, thanks) have suggested me vla-InsertBlock, which I tried and it works. I will use that one. Thanks again Riccardo Ferrari2 points
-
@Riccardo_Ferrari to insert a drawing from an external file, you have to use either (command "._Insert ...) or use (vla-InsertBlock) https://help.autodesk.com/view/OARX/2025/ESP/?guid=GUID-17F86FDD-B7FC-4F43-9F16-B4958F73A66D2 points
-
Like you @tombu we had a dwt which had all the blocks required for CIV3D and yes waiting for the palette to display was a pain, the old fashioned using a POP Image menu was much easier to use, and you could select via subject rather than all.2 points
-
If it doesn't work - could try vl-princ-to-string or vl-prin1-to-string see if that works in your code or in string to list2 points
-
@Nikon There were a few errors in the code you posted .. FWIW here are some modifications with comments. ;; Create a new text style and replace all styles in the drawing (defun c:cr-txtst-sel2 ;; RJP - Localize all variables (/ acaddoc eo ff i objstyle oldcmd select ss styles) (vl-load-com) ;; RJP - Check that the font can be found otherwise BOOM! Also search for the system font not tied to a CAD version (if (findfile (setq ff (strcat (getenv "WINDIR") "\\FONTS\\ARIALN.ttf"))) ;; (findfile (setq ff "C:\\Program Files\\Autodesk\\AutoCAD 2019\\Fonts\\ARIALN.ttf")) (progn (setq acaddoc (vla-get-activedocument (vlax-get-acad-object))) (setq styles (vla-get-textstyles acaddoc)) ;; Add the style named "ArialN0" (setq objstyle (vla-add styles "ArialN0")) ;; Assign fontfile "ARIALN.ttf" to the style (vla-put-fontfile objstyle ff) ;; Optional: Make the new style Active (vla-put-activetextstyle acaddoc objstyle) ;; Replace All/Select texts with the ArialN0 style (initget "All Select") (if (= "All" (setq select (getkword "\nSelect text to change [All/Select] <Select> : "))) (setq ss (ssget "_X" '((0 . "*TEXT")))) (setq ss (ssget "_:L" '((0 . "*TEXT")))) ) ;; RJP - Check for valid selection (if ss (progn (setq oldcmd (getvar "cmdecho")) (setvar "cmdecho" 0) (repeat (setq i (sslength ss)) (setq eo (vlax-ename->vla-object (ssname ss (setq i (1- i))))) ;; RJP - Check that the text can be modified (if (vlax-write-enabled-p eo) (vlax-put eo 'stylename "ArialN0") ) ) ;; RJP - This line below bombs the code? ;; (vla-endundomark doc) ; Set the style to the current one (vl-cmdf "_-PURGE" "_ST" " " "_N") ; clear unused text styles (setvar "cmdecho" oldcmd) ) ) ) (alert (strcat ff " NOT FOUND!")) ) (princ) )2 points
-
Here's another, not quite as advanced as CAB's BreakAll program, but I had fun writing it - (defun c:breakwith ( / *error* brk brl ent ftr idx sel ) (defun *error* ( msg ) (LM:endundo (LM:acdoc)) (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*"))) (princ (strcat "\nError: " msg)) ) (princ) ) (setq ftr (list '(0 . "ARC,CIRCLE,ELLIPSE,LINE,*POLYLINE,SPLINE") '(-4 . "<NOT") '(-4 . "<AND") '(0 . "POLYLINE") '(-4 . "&") '(70 . 80) '(-4 . "AND>") '(-4 . "NOT>") (if (= 1 (getvar 'cvport)) (cons 410 (getvar 'ctab)) '(410 . "Model")) ) ) (LM:startundo (LM:acdoc)) (cond ( (not (setq sel (LM:ssget "\nSelect objects to break: " (list "_:L" ftr))))) ( (not (setq brk (LM:ssget "\nSelect breaking edges: " (list ftr))))) ( (progn (repeat (setq idx (sslength brk)) (setq idx (1- idx) ent (ssname brk idx) ) (if (not (ssmemb ent sel)) (setq brl (cons (vlax-ename->vla-object ent) brl)) ) ) (null brl) ) (princ "\nAll selected breaking edges were also selected to be broken.") ) ( (repeat (setq idx (sslength sel)) (setq idx (1- idx)) (breakwithlist (ssname sel idx) brl 1) ) ) ) (*error* nil) (princ) ) (defun breakwithlist ( ent lst mxd / cmd enl obj pnt pt1 pt2 tmp ) (cond ( (< 256 mxd)) ;; Just in case ( (setq obj (vlax-ename->vla-object ent) pt1 (vlax-curve-getstartpoint ent) pt2 (vlax-curve-getendpoint ent) pnt (vl-some '(lambda ( x ) (vl-some '(lambda ( p ) (if (and (not (equal p pt1 1e-8)) (not (equal p pt2 1e-8)) ) p ) ) ( (lambda ( l / r ) (repeat (/ (length l) 3) (setq r (cons (mapcar '(lambda ( a b ) a) l '(0 1 2)) r) l (cdddr l) ) ) (reverse r) ) (vlax-invoke obj 'intersectwith x acextendnone) ) ) ) lst ) ) (setq enl (entlast) cmd (getvar 'cmdecho) pnt (trans pnt 0 1) ) (while (setq tmp (entnext enl)) (setq enl tmp) ) (setvar 'cmdecho 0) (vl-cmdf "_.break" (list ent pnt) "_f" "_non" pnt "_non" pnt) (setvar 'cmdecho cmd) (if (entnext enl) (breakwithlist ent lst (1+ mxd)) ) (while (setq enl (entnext enl)) (breakwithlist enl lst (1+ mxd)) ) ) ) ) ;; ssget - Lee Mac ;; A wrapper for the ssget function to permit the use of a custom selection prompt ;; msg - [str] selection prompt ;; arg - [lst] list of ssget arguments (defun LM:ssget ( msg arg / sel ) (princ msg) (setvar 'nomutt 1) (setq sel (vl-catch-all-apply 'ssget arg)) (setvar 'nomutt 0) (if (not (vl-catch-all-error-p sel)) sel) ) ;; Start Undo - Lee Mac ;; Opens an Undo Group. (defun LM:startundo ( doc ) (LM:endundo doc) (vla-startundomark doc) ) ;; End Undo - Lee Mac ;; Closes an Undo Group. (defun LM:endundo ( doc ) (while (= 8 (logand 8 (getvar 'undoctl))) (vla-endundomark doc) ) ) ;; Active Document - Lee Mac ;; Returns the VLA Active Document Object (defun LM:acdoc nil (eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object)))) (LM:acdoc) ) (vl-load-com) (princ)2 points
-
I have done translations before. I'd suggest using Notepad ++ to open the file because it keeps the foreign characters for a better translation than regular Notepad. Then use Google Translate or some other translator and translate the comments only at first. This way you understand what the program is doing. Then, only translate the prompts. If the program works as it is, I wouldn't tinker with it too much. Some of the prompts may have some setq variables to adjust, but keep it simple.2 points
-
2 points
-
or put them on temp layer first , then change style / layer. Not sexy but dragonproof.2 points
-
2 points
-
You are entirely welcome. I wish you every success come the New Year.2 points
-
I would add a does new layer exist ? The oldlayer ssget will fail if the layer does not exist so that is handled. (if (= (tblsearch "LAYER" newlayer) nil) (command "-layer" "m" newlayer "C" 3 "" "") )2 points
-
A like... see what I did there....2 points
-
Just wanted something more flexible , user friendly and sexier for me , myself and I2 points
-
Hi @mhy3sx... I've updated my last posted code... Now it won't miss anything... I checked it and it worked well with fuzz = 1.0... HTH. Regards, M.R.2 points
-
Using VLAX can save a couple of lines when getting pline points. (setq r (vlax-get ob 'coordinates)) I tend to use this, I think it was a suggestion by Lee-Mac. (setq plent (entsel "\nPick rectang")) (if plent (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent))))))2 points
-
I have moved your thread to the AutoLISP, Visual LISP & DCL Forum. Please post in the correct forum.2 points
-
I have select a dynamic block you will then be asked to pick say a visibility state or in your case an extrusion shape. Not sure how that works. It is a global routine works for any dynamic block. It will need changing to suit your task. Post a block or send via PM if you have copyright problems. Need one to look at. .Multi radio buttons.lsp Dynamic block get-put-part2.lsp2 points
-
Why not do it all in one go ? That is what I am suggesting. @Dadgad is hinting can help he can use the front end if useful, was done using this. The profiles could be selected from images rather than just a description. Multi GETVALS.lsp2 points
-
2 points
-
I have 2 make layouts lisp, working on a 3rd method. You can walk along a p/Line and it makes rectangs at correct scale matching your title block, it rotates the rectangs to following the line work so layouts are displayed horizontally. The second is a more grid style where you just make the 1st rectang at scale again then copy it see movie. The 3rd doing now is for more a parts style solution just pick a point in model, select scale and title block, matching layout is made. Draw rectangs.mp4 Ok a comment , for me you don't scale your mview shape, rather the mview is fixed shape within a title block, the title block exists in a layout at 1:1 scale, true size, the mview has its scale set to desired scale. See image above. Withe the title block fixed and at a known point like 0,0 it makes auto plotting easy. Ok I charge a price like a cup of coffee as the code needs to be set up to suit your title blocks. Yes can be imperial or metric. Also check the word doc.Lisp files Apr 2024.docx2 points
-
2 points
-
code updated, much faster (29objects in 1.3sec) (defun copy-entity (entity) ;; Get all DXF codes for the entity (setq entdata (entget entity)) ;; Create a new entity with the same DXF codes (entmakex entdata) ;; Return the newly created entity name (entlast)) (defun c:txt2mtxZW (/ ss ssFiltered ent entdata txt_height txt_widthfactor txt_obliqueangle txt_style style_obj style_data font_name entlast_set i text1 text1cont first_char mtext1 mtext1cont dummy_txt1 dummy_mtxt1 dummy_txt1_vert1 dummy_mtxt1_vert1 diffX diffY insert_point elast elast1 new new1) ;; Ask to select TEXT objects (setq ss (ssget '((0 . "TEXT")))) (princ (strcat "\nNumber of TEXT objects selected: " (itoa (sslength ss)))) ;; For the first selected object, read its properties (if ss (progn (setq ent (ssname ss 0)) (setq entdata (entget ent)) ;; Get text height (setq txt_height (cdr (assoc 40 entdata))) (princ (strcat "\nText Height: " (rtos txt_height 2 2))) ;; Get text width factor (setq txt_widthfactor (cdr (assoc 41 entdata))) (princ (strcat "\nText Width Factor: " (rtos txt_widthfactor 2 2))) ;; Get text oblique angle (setq txt_obliqueangle (cdr (assoc 51 entdata))) (princ (strcat "\nText Oblique Angle: " (rtos txt_obliqueangle 2 2))) ;; Get text style (setq txt_style (cdr (assoc 7 entdata))) (princ (strcat "\nText Style: " txt_style)) ;; Get font name from text style (setq style_obj (tblobjname "style" txt_style)) (setq style_data (entget style_obj)) (setq font_name (cdr (assoc 3 style_data))) (princ (strcat "\nFont Name: " font_name)) ;; Create the new text style Standard_parcels (entmakex (list '(0 . "STYLE") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbTextStyleTableRecord") ; Subclass marker (AcDbTextStyleTableRecord) (cons 2 "Standard_parcels") ; Style name '(70 . 0) ; Standard flag values (bit-coded values): (cons 40 0.0) ; Fixed text height; 0 if not fixed (cons 41 txt_widthfactor) ; Width factor (cons 50 txt_obliqueangle) ; Oblique angle '(71 . 0) ; Text generation flags: '(42 . 0.0) ; Last height used (cons 3 font_name) ; Primary font file name '(4 . "") ; Bigfont file name; blank if none ) ) (princ "\nText style Standard_parcels created.") ;; Set Standard_parcels as the current text style (setvar "TEXTSTYLE" "Standard_parcels") (princ "\nText style Standard_parcels has been set as current.") ;; Create the selection set for TEXT objects (setq ss (ssget '((0 . "TEXT")))) (princ (strcat "\nNumber of TEXT objects in selection set: " (itoa (sslength ss)))) (setq entlast_set (ssadd)) (start-timer) ;; Iterate through each selected TEXT entity (setq i 0) (while (< i (sslength ss)) (setq text1 (ssname ss i)) ;; Read the text content from text1 (setq text1cont (cdr (assoc 1 (entget text1)))) ;(setq first_char (substr text1cont 1 1)) (setq first_char text1cont) ;; Copy text1 using the new function (setq text1_copy (copy-entity text1)) ;; Convert TEXT to MTEXT (command "_txt2mtxt" text1 "") ;; Assign the last created entity to mtext1 (setq mtext1 (entlast)) ;; Read the text content from mtext1 (setq mtext1cont (cdr (assoc 1 (entget mtext1)))) ;; Change the text style of mtext1 to Standard_parcels (entmod (subst (cons 7 "Standard_parcels") (assoc 7 (entget mtext1)) (entget mtext1))) ;; Read the insertion point from mtext1 (setq insert_point (cdr (assoc 10 (entget mtext1)))) ;; Change the text content to first_char in text1_copy and mtext1 (entmod (subst (cons 1 first_char) (assoc 1 (entget text1_copy)) (entget text1_copy))) (entmod (subst (cons 1 first_char) (assoc 1 (entget mtext1)) (entget mtext1))) ;; Copy text1_copy to a new location before exploding (setq text1_copy_explode (copy-entity text1_copy)) ; (setq text1_copy_explode (copy-entity text1_copy)) ;; Use the _txtexp command on text1_copy_explode (setq elast (entlast)) ; mark last-drawn entity before copying (setq new (ssadd)) ; start empty selection set (command "_txtexp" text1_copy_explode "") ;; Create selection set (while (setq elast (entnext elast)) (setq new (ssadd elast new))) ;; Assign the created entity to dummy_txt1 (setq dummy_txt1 (entlast)) ;; Read the first vertex from dummy_txt1 (setq dummy_txt1_vert1 (vlax-curve-getPointAtDist dummy_txt1 0.0)) ;; Copy mtext1 to a new location before exploding (setq mtext1_copy_explode (copy-entity mtext1)) ; (setq mtext1_copy_explode (copy-entity mtext1)) ;; Use the _txtexp command on mtext1_copy_explode (setq elast1 (entlast)) ; mark last-drawn entity before copying (setq new1 (ssadd)) ; start empty selection set (command "_txtexp" mtext1_copy_explode "") ;; Create selection set (while (setq elast1 (entnext elast1)) (setq new1 (ssadd elast1 new1))) ;; Assign the created entity to dummy_mtxt1 (setq dummy_mtxt1 (entlast)) ;; Read the first vertex from dummy_mtxt1 (setq dummy_mtxt1_vert1 (vlax-curve-getPointAtDist dummy_mtxt1 0.0)) ;; Calculate the differences in X and Y coordinates (setq diffX (- (car dummy_mtxt1_vert1) (car dummy_txt1_vert1))) (setq diffY (- (cadr dummy_mtxt1_vert1) (cadr dummy_txt1_vert1))) (princ "\n") (princ diffY) (princ "\n") ;; Change the insertion point coordinates in mtext1 (entmod (subst (cons 10 (list (- (car insert_point) diffX) (- (cadr insert_point) diffY) 0.0)) (assoc 10 (entget mtext1)) (entget mtext1))) ;(entmod (subst (cons 10 (list (- (car insert_point) diffX) ((cadr insert_point) 0.0) (assoc 10 (entget mtext1)) (entget mtext1))) ;; Restore the text content in text1_copy and mtext1 (entmod (subst (cons 1 text1cont) (assoc 1 (entget text1_copy)) (entget text1_copy))) (entmod (subst (cons 1 mtext1cont) (assoc 1 (entget mtext1)) (entget mtext1))) ;; Assign text1_copy back to text1 (setq text1 text1_copy) ;; Delete dummy_txt1 and dummy_mtxt1 entities (entdel dummy_txt1) (entdel dummy_mtxt1) (command "_erase" new "") (command "_erase" new1 "") ;; Add mtext1 to entlast_set (setq entlast_set (ssadd mtext1 entlast_set)) (setq i (1+ i)) ) (princ (strcat "\nNumber of MTEXT entities created: " (itoa (sslength entlast_set)))) (stop-timer) ) ) (princ) ) (defun start-timer () "Start the timer and store the start time." (setq start-time (getvar "DATE"))) (defun stop-timer () "Stop the timer, calculate the elapsed time, and display it." (setq end-time (getvar "DATE")) ;; Calculate the elapsed time in seconds (setq elapsed-time (* (- end-time start-time) 86400.0)) ;; Display the elapsed time (princ (strcat "\nElapsed Time: " (rtos elapsed-time 2 2) " seconds")) (princ)) (defun copy-entity (entity) ;; Get all DXF codes for the entity (setq entdata (entget entity)) ;; Create a new entity with the same DXF codes (entmakex entdata) ;; Return the newly created entity name (entlast))1 point
-
1 point
-
@Akanezuko If I'm interpreting you correctly - try this: (defun c:SelinPoly (/ es ob pts r ss) (if (and (setq es (entsel "\nSelect a polygon: ")) (= (cdr (assoc 0 (entget (car es)))) "LWPOLYLINE") ) (progn (setq ob (vlax-ename->vla-object (car es)) pts (vla-get-coordinates ob) pts (vlax-safearray->list (vlax-variant-value pts)) ) (while pts (setq r (cons (list (car pts) (cadr pts)) r) pts (cddr pts) ) ) (if (> (length r) 2) (progn (entdel (car es)) (setq ss (ssget "CP" r '((0 . "*POLYLINE")))) (entdel (car es)) (sssetfirst nil ss) ) (princ "\nSelected Polygon must be more than 2 points.") ) ) (princ "\nYou must select a Polygon.") ) (princ) )1 point
-
Not sure on ZWCAD, but my last post shows a perfect match with width = 1 and line space style set exact. If those options are not available in ZWCAD, we need to determine an alternative solution to do the same thing. I am very busy at work, but I'll try to do what I can, later maybe, otherwise next week. Hopefully someone with ZWCAD can jump in.1 point
-
BINGO! Work smart, not hard. Layer States, or rather the judicious use of Layers can be extremely helpful, non-intuitive and highly effective.1 point
-
You're welcome - though, note that there's no need to initialise the two output variables as LISP is not strongly typed.1 point
-
1 point
-
In your radio button action tile you should be able to put the open image function in there so when you change the radio button it will open, same as if it was in 'OK', or call a subroutine to do the processing you want. A lot of respect to the Dragon, and I think his plan might be better that you create a list of images to open, and on 'OK' close the dialogue and open the images at the end. If you open each on a radio button click the opened image will take the focus of your computer and you'll have to keep jumping back to CAD for the next image... it won't be as quick as you might think. Select them first and open them all at the end will be a quicker process.1 point
-
1 point
-
You're gona need to built a list with the filenames for all the images (with toggles / listbox) and the very last line in your code must be (foreach image image-list (attach / open / insert whatever ...)) some help here : https://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-10F5B2F6-5D84-4B60-8ED5-D0B3A2644275 (vl-load-com) (defun c:Example_ImageFile() ;; This example inserts a raster image and then finds the ;; ImageFile for the image. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; This example uses the "2d Projected Polylines.jpg" found in the Sample ;; directory. If you do not have the image, or if it is located ;; in a different directory, insert a valid path and name for the ;; imageName variable below. (setq insertionPoint (vlax-3d-point 5 5 0) imageName ".\\Sample\\VBA\\2d Projected Polylines.jpg" scalefactor 1 rotAngle (/ (* 0 3.141592) 180)) ;; Creates a raster image in model space (if (/= (findfile imageName) nil) (progn (setq modelSpace (vla-get-ModelSpace doc)) (setq raster (vla-AddRaster modelSpace (findfile imageName) insertionPoint scalefactor rotAngle)) (vla-ZoomExtents acadObj) ) (alert (strcat imageName " could not be found.")) ) ;; Find the current ImageFile (vla-Regen doc :vlax-true) (alert (strcat "The ImageFile is currently set to: " (vla-get-ImageFile raster))) )1 point
-
1 point
-
Had another look at this one, if you entmake the mtext using the text as a basis, it will shift in a similar way to txt2mtxt command. The insert points are still the same as in your example but it is as if there is a border around dtext that isn't there in mtext. Might have to accept that this is still a bit buggy to get them lined up exactly. Test code but noting the new mtext in this retains the width of the text style - would need to add a bit more to adjust that to the original taxt width (defun c:test ( / MyEnt ) ;; Get entity data (setq MyEnt (car (entsel "Select Text"))) ;; Select Entity (setq MyEntHJust (cdr (assoc 72 (entget MyEnt)))) ;; Get H Justification (setq MyEntVJust (cdr (assoc 73 (entget MyEnt)))) ;; Get V Justification ;;Get justification codes (if (= MyEntHJust 0)(setq JU 1)) (if (= MyEntHJust 1)(setq JU 2)) (if (= MyEntHJust 2)(setq JU 3)) (if (= MyEntHJust 3)(setq JU 1)) (if (= MyEntVJust 0)(setq JU (+ JU 6))) (if (= MyEntVJust 1)(setq JU (+ JU 6))) (if (= MyEntVJust 2)(setq JU (+ JU 3))) (if (= MyEntVJust 3)(setq JU (strcat JU 0))) ;; Create mtext (entmake (list '(0 . "MTEXT") '(100 . "AcDbEntity") (assoc 410 (entget MyEnt)) ;; space (assoc 8 (entget MyEnt)) ;; layer (if (= (assoc 62 (entget MyEnt)) nil)(cons 62 256) (assoc 62 (entget MyEnt)) ) '(100 . "AcDbMText") (assoc 10 (entget MyEnt)) ;; insert point (assoc 40 (entget MyEnt)) ;; text height (cons 71 JU) ;; attachment point, 0-9 '(72 . 5) (assoc 1 (entget MyEnt)) ;; text value (assoc 7 (entget MyEnt)) ;; text style (assoc 41 (entget MyEnt)) ;; Width (cons 42 (cdr (assoc 41 (entget MyEnt)))) ;; text width (assoc 50 (entget MyEnt)) ;; rotation '(73 . 1) ;; line spacing '(44 . 1.0) ;; line spacing factor )) (princ) )1 point
-
If you place them on different layers, there can be a huge batch from which to select.1 point
-
You might want, or be able to xref them in? I haven't really worked with Dynamic blocks much, although when they were first introduced, I was keen to delve into them. Using ProSteel add on these days, I don't have nearly as much use for them as back in the day.1 point
-
PRESSPULL it is . I haven't used it in years, have a shortcall set as PP. I've done quite a bit of sometimes rather complex 3D modeling. PP is much easier to use than EXTRUDE, because it will work on just about anything. Doesn't require a CLOSED polyline. I am still under the gun, trying to get a new project issued for fabrication. When time permits I'll come back and play with this a bit.1 point
-
Just a ps made a movie of the 3rd method buts its like 38Mb if you want to look at it can send just PM me with an email link, will send via Wetransfer.1 point
-
If you use VL can use the Textoverride property. (defun c:wow ( / obj str) (setq obj (vlax-ename->vla-object (car (entsel "\nPick text object ")))) (setq str (vlax-get obj 'textstring)) (setq obj (vlax-ename->vla-object (car (entsel "\nPick Dim object ")))) (vlax-put obj 'Textoverride str) (princ) ) ; (vlax-put obj 'Textoverride (strcat "<> " str))1 point
-
From the documentation, the StationOffset method will accept an X & Y coordinate and return two output parameters (station & offset), as such, you'll need to supply the appropriate number of parameters, e.g.: (vlax-invoke-method objAlign 'StationOffset (car point) (cadr point) 'stn 'off) (print stn) (prin1 off)1 point
-
Note, Explode, PurgeAll and plot are all part of the API, accessible through pyautocad or win32com I'll add it1 point
-
Please use Code Tags for your code in the future. (<> in the editor toolbar)1 point
-
“but with the AutoCAD to accepting anything.” then test IAcadState. state : Ax.IAcadState = theApp.GetAcadState() print(state.IsQuiescent) # True: AutoCAD is idle ActiveX is COM automation, this is what pyautocad and win32com use to communicate with AutoCAD. I used win32com’s makepy to generate the interface, then added converters to remove the need for variants. PyRx is in process, the procedure is load in a python script with PyLoad, then run it, a quick example import traceback from pyrx_impx import Rx, Ge, Gi, Db, Ap, Ed, Ax #creates a new command xdoit1 def PyRxCmd_xdoit1(): try: theApp = Ax.getApp() doc = theApp.ActiveDocument blk = doc.Blocks.Add([0, 0, 0], "MYBLOCK") blk.AddAttribute( 1, Ax.constants.acAttributeModeVerify, "New Prompt", [0, 0, 0], "NEW_TAG", "New Value", ) except Exception as err: traceback.print_exception(err)1 point
-
Do not agreed with you The Earth is so small, take a look on map - just 5-6 thousand of miles or so Here is edited version This will create the new text entity with the same properties as the first selected text has (defun C:STX (/ cpent elist en ip newtxt pt ss sum sumtxt txt) (princ "\n\t\t>>> Select text to get summ >>>") (if ;;select texts/mtexts on screen : (setq ss (ssget '((0 . "*TEXT")))) ;; if selected then : (progn ;; store the first text entity for using 'em further : (setq cpent (ssname ss 0)) ;; set initial sum to zero : (setq sum 0.) ;; loop trough selected texts/mtexts : (while ;; get the first text in selection : (setq en (ssname ss 0)) ;; get entity list of them : (setq elist (entget en)) ;; get the textstring by key 1 from entity list : (setq txt (cdr (assoc 1 elist))) ;; create output string : (setq sumtxt ;; concatenate strings : (strcat ;; convert digits to string : (rtos ;; add to summ the digital value of text : (setq sum (+ (atof txt) sum)) ;; 2 is for metric units (3 for engineering) : 2 ;; set precision by current : (getvar "dimdec"))) ) ;; delete entity from selection set : (ssdel en ss) ) ;; display message in the command line: (princ (strcat "\nSumm=" sumtxt)) (setq pt (getpoint "\nSpecify the new text location: ")) ;; get the insertion point of stored entity : (setq ip (cdr (assoc 10 (entget cpent)))) ;; copy text entity to the new destination point : (command "_copy" cpent "" ip pt) ;; get the last created entity : (setq newtxt (entlast)) ;; get entity list of them : (setq elist (entget newtxt)) ;; modify entity list with new text string : (entmod (subst (cons 1 sumtxt)(assoc 1 elist) elist)) ;; update changes : (entupd newtxt) ) ) (princ) ) (princ "\nStart command with STX...") (princ) ~'J'~1 point