Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/24/2021 in all areas

  1. If one magnifies the given sketch, the "12" dimension is not at the apex of the curve and is therefore not tangential to the R22 arc. However everybody's eyes are different!!
    1 point
  2. Just to check that you were selecting the dimension, or other text, rather than some other point or object such as a line
    1 point
  3. Red box is easy its a function Bounding box. (setq obj (vlax-ename->vla-object (car (entsel "pick object ")))) (vla-GetBoundingBox obj 'minpoint 'maxpoint) (setq pointmin (vlax-safearray->list minpoint)) (setq pointmax (vlax-safearray->list maxpoint)) ;minpoint contains the minimum point of the bounding box ;maxpoint contains the maximum point of the bounding box
    1 point
  4. Here's my interpretation. Note the small gap between the R10 and R22 arcs. I added a line tangent to the two arc to complete the profile. With no decimal places on most dimensions the gap of 0.24 could assumed to be 0 with roundoff.
    1 point
  5. It irks me when an apparently simple drawing exercise should prove not straight forward. After much pondering, I think the dimension of 12 is the red herring and does not add to the information necessary to draw the figure.
    1 point
  6. @ancrayzy what you are asking for is a custom program and not codes to learn from so you asked how to get lengths of dynamic blocks and I guided you how to make it and @BIGAL gathered the codes for you to start from then you are now talking about table , dimensions, ... etc. which means full program. Contact me if you can pay for the program.
    1 point
  7. The one bit I keep forgetting... add this code in after the first line and see what it does (defun getent ( aprompt / enta entb pt ) (princ "\n") (setq enta (car (nentsel aprompt))) (setq pt (cdr (assoc 10 (entget enta))) ) ;;;;fix for nenset or entsel requirements (setq entb (last (last (nentselp pt)))) (if (and (/= entb nil) (/= (type entb) 'real) ) (progn (if (wcmatch (cdr (assoc 0 (entget entb))) "ACAD_TABLE,*DIMENSION")(setq enta entb)) ) ) enta ) It should now be and your dimension will be shown in the command line text01 in this LISP ready to add to a table (defun c:dynamicdimtext ( / ent1 entcodes1 entlist1 text01 ) (defun getent ( aprompt / enta entb pt ) (princ "\n") (setq enta (car (nentsel aprompt))) (setq pt (cdr (assoc 10 (entget enta))) ) ;;;;fix for nenset or entsel requirements (setq entb (last (last (nentselp pt)))) (if (and (/= entb nil) (/= (type entb) 'real) ) (progn (if (wcmatch (cdr (assoc 0 (entget entb))) "ACAD_TABLE,*DIMENSION")(setq enta entb)) ) ) enta ) (defun getfroment (ent entcodes / acount acounter mytext newtext stringtext) ;;get dotted pairs list (setq entlist (entget ent)) (setq acount 0) (while (< acount (length entlist)) (setq acounter 0) (while (< acounter (length entcodes)) (setq entcode (nth acounter entcodes)) (if (= (car (nth acount entlist)) entcode ) (progn (setq newtext (cdr (nth acount entlist))) (if (numberp newtext)(setq newtext (rtos newtext))) ;fix for real numbers (setq mytext (append mytext (list (cons (car (nth acount entlist)) newtext) )) ) );end progn );end if (setq acounter (+ acounter 1)) );end while (setq acount (+ acount 1)) );end while ;;get string from dotted pair lists (if (> (length mytext) 0) (progn (setq acount 0) (setq temptext "") (while (< acount (length mytext)) (setq temptext (cdr (nth acount mytext)) ) (if (= stringtext nil) (setq stringtext temptext) (setq stringtext (strcat stringtext temptext )) );end if (setq acount (+ acount 1)) );end while );end progn );end if (if (= stringtext nil)(setq stringtext "")) (setq mytext stringtext) mytext ) ;;get text as a string (defun gettextasstring ( enta entcodes / texta ) (if (= (getfroment enta entcodes) "") () (setq texta (getfroment enta entcodes)) ) texta ) ;;get text 1 (setq ent1 (getent "\nSelect Dimension : ")) (setq entlist1 (entget ent1)) (setq entcodes1 (list 4 1 172 304)) (setq text01 (gettextasstring ent1 entcodes1) ) ;Text as string (setq text01 (LM:UnFormat text01 "" )) (princ text01) ) ;;-------------------=={ UnFormat String }==------------------;; ;; ;; ;; Returns a string with all MText formatting codes removed. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; str - String to Process ;; ;; mtx - MText Flag (T if string is for use in MText) ;; ;;------------------------------------------------------------;; ;; Returns: String with formatting codes removed ;; ;;------------------------------------------------------------;; (defun LM:UnFormat ( str mtx / _replace rx ) (defun _replace ( new old str ) (vlax-put-property rx 'pattern old) (vlax-invoke rx 'replace str new) ) (if (setq rx (vlax-get-or-create-object "VBScript.RegExp")) (progn (setq str (vl-catch-all-apply (function (lambda ( ) (vlax-put-property rx 'global actrue) (vlax-put-property rx 'multiline actrue) (vlax-put-property rx 'ignorecase acfalse) (foreach pair '( ("\032" . "\\\\\\\\") (" " . "\\\\P|\\n|\\t") ("$1" . "\\\\(\\\\[ACcFfHLlOopQTW])|\\\\[ACcFfHLlOopQTW][^\\\\;]*;|\\\\[ACcFfHLlOopQTW]") ("$1$2/$3" . "([^\\\\])\\\\S([^;]*)[/#\\^]([^;]*);") ("$1$2" . "\\\\(\\\\S)|[\\\\](})|}") ("$1" . "[\\\\]({)|{") ) (setq str (_replace (car pair) (cdr pair) str)) ) (if mtx (_replace "\\\\" "\032" (_replace "\\$1$2$3" "(\\\\[ACcFfHLlOoPpQSTW])|({)|(})" str)) (_replace "\\" "\032" str) ) ) ) ) ) (vlax-release-object rx) (if (null (vl-catch-all-error-p str)) str ) ) ) )
    1 point
  8. case0. Run PURGE, AUDIT case1. Clean up DGN rubbish (paste to command line include "( )" ) (dictremove (namedobjdict) "acad_dgnlinestylecomp") if anwer is "nil", your drawing is clean case2. use delproxy https://forums.autodesk.com/t5/autocad-forum/proxy-objects-acad-p-id-how-do-you-purge-them/td-p/2582872 case3. use delblank (maybe purge do this) https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/find-and-delete-a-block-if-attributes-are-blank/td-p/2524433 case4. DWG->DXF->DWG converting by save as or by command DXFOUT, DXFIN case5. DWG version downgrade by save as then save as latest version case6. select contents to preserve then use WBLOCK command. case7. Detach all XREF : -XREF > D > * case8. It doesn't matter if the drawing is changed select all - qse (quickselect) - set filter to all block - explode loop this until no more blocks are selected then redo this routine from case0
    1 point
×
×
  • Create New...