Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/22/2018 in all areas

  1. 2 points
  2. Much better this morning! In two days, CADTutor.net has seen more improvements than the entire web staff of a giant CAD corporation has managed to do in over 4 months on their forums.
    2 points
  3. I certainly see an improvement, much quicker. Well done.
    2 points
  4. OK, speed optimisation is done for now. The site feels significantly faster to me - how does it feel for you? For those who want the details, there have been a number of server and forum tweaks, including: A move from PHP 5.6 to PHP 7.2 on the server with PHP now using Zend opcache. The forum is now utilising the Redis caching method and some file functions moved to MySQL. In a few weeks time we'll be upgrading MySQL from 5.6 to 5.7. That may also give a little speed boost but the bulk of optimisation is now complete. Thanks for bearing with me during the transition period.
    2 points
  5. In addition to the Drag/Drop feature, you can simply Ctrl+V paste any Windows Copied image directly into the editor window. Using Windows snipping tool, just Copy the image and it inserts seamlessly. I cannot express how much more efficient this is for sharing that ever-so-helpful quick screenshot to point inquirers in the right direction. -TZ
    2 points
  6. I would pay $14 then I could use the spare time to play here at cadtutor and the boss would not know.
    2 points
  7. Thanks. Yeah, it looks like a fair win/win option. I like that. While i'm here, here's some more feedback Positive: I really like when you are on a thread you get a popup telling you if someone posted something new even as you are writing something. That is awesome. (edit:) THIS FORUM KEEPS MO LOGGED ON FOR MORE THAN 120 SECONDS WITHOUT DISCONNECTING ME!! WOOT!! What I think I like less: The "shift+enter" for a line return instead of just "enter" (might get used to it some day, but try fighting it while adding bulleted lists....^^) Uncertain: The reputation points/leaderboard system (still not sure it is a good thing...) Why I'm not sure the point and leaderboard is a good thing? I think we have here an excellent example. I brought a good argument for signatures. One agrees at 100%, another that it is a good point, Yet the argument has no reactions, while you got one merely stating "That's a good point and it's only fair that there should be some quid pro quo for your contributions. Let me think about the options.". Not only it could be somewhat frustrating, but might lead to some unhealthy competition if we focus on it too much. It is also quantitative more than qualitative, as a user with 100 points over 1000 posts might look better on paper than a user with 50 points over 75 posts. To make a qualitative comparison one can check the reputation/posts ratio, but the result is biased since they are not spanned over the same time frame and people can have lots of posts without reputation as of now. On the other hand it might help positively influence since the good comments can be "rewarded" but I have the feeling that one could get more rep points by being fast to copy and paste a code snippet than taking the time to make lengthy discussions, suggestions and explain concepts in detail. If so, it could potentially lower the academic value. I guess time will tell. (edit) I just figured out how to vote. Wondering the different effects of different voting options...
    1 point
  8. That's a good point and it's only fair that there should be some quid pro quo for your contributions. Let me think about the options.
    1 point
  9. Enable Polar Tracking and set APERTURE to 50.
    1 point
  10. Yeah this is exactly what I'd like. I'll have to go to the lisp section for this then. Thank you very much!
    1 point
  11. That would be very complex to do, since when you break a line it creates a new one and you don't have any way to retrieve the entities to make the pline. One way would be to collect the coordinate from the original line, and create the 2 broken sections and the notch lines using entmakex, and use the returned enames to create the poly. That might not be an ideal 2nd lesson for a starter tho. I'm glad I could help. If you want to show your appreciation, I think you can upvote/+ the replies to give points to the people that helped you.
    1 point
  12. Few things is for sure: the code I posted might not be totally bullet proof, but it does work. Good news: I'm totally able to reproduce the result you describe: your current layer is off. We can take care of it programmatically, as any other fail safes, of course the code will get more complex as we go. We will dig deeper on that. Actually we calculate the 2 points using the angle. Ok, so now that we figured out that if the current layer is off, we need to choose what to do with it. When it is off, the result is still there and good, just not shown. The 3 options are A) We either do nothing and keep executing the code anyway. B) We just turn it on and leave it on or C) We turn it on just to see what we are doing and then restore it to its previous state. Good programming practice is to always leave the user environment exactly as it was before the execution of the code. Don't we hate when routines leave variables and settings changed after completion... but here, turning the layer back off might seems kind of strange. We also have the choice on how to do it. For beginners it might be easier to achieve things using command calls. I've localized the variables (ss pt1 pt2 and *error*, as well as tmp, a new one i created to keep track of the layer status). Here's the modified code. (defun c:rg ( / *error* oldosmode ra ss cyan_polyline_obj i_pt p_pt aa rra hyp pt1 pt2 tmp) (defun *error* ( msg ) (setvar 'osmode oldosmode) (if tmp (command "_layer" "_off" (getvar 'clayer) "_Y" "" )) (if (and msg (not (member msg '("Function cancelled" "quit / exit abort"))) ) (princ (strcat "\nError: " msg)) ) (princ) ) (setq oldosmode (getvar 'osmode)) (if (setq tmp (minusp (cdr (assoc 62 (tblsearch "layer" (getvar 'clayer)))))) (command "_layer" "_on" (getvar 'clayer)"") (setq tmp nil) ) (setq ra (getangle "\nAngle of Groove ")) (while (setq ss (car (entsel "\nSelect CYAN Polyline: "))) (setq cyan_polyline_obj (vlax-ename->vla-object ss)) (setq i_pt (getpoint "\nSelect Insertion Point on Blue Line ")) (setq p_pt (vlax-curve-getClosestPointTo cyan_polyline_obj i_pt)) (setq aa (distance i_pt p_pt));Angle Adjacent Distance (setq rra (angle i_pt p_pt)); getting an angle from 2 points (setq hyp (/ aa (cos (/ ra 2)))); Calculate Hypotenuse Length (setq pt1 (polar i_pt (+ rra (/ ra 2)) hyp)); Calculates Point 1 (setq pt2 (polar i_pt (- rra (/ ra 2)) hyp)); Calculates Point 2 (command "line" i_pt pt1 "") (command "line" i_pt pt2 "") (command "Break" ss pt1 pt2) );end loop (*error* nil) )
    1 point
  13. Amen To That ! Much better
    1 point
  14. Just a nitpicky thing but: ;;This (if (= timber_length nil) (setq timber_length "4800") ) (if (= ply_length nil) (setq ply_length "2400") ) ;; Could be this (or timber_length (setq timber_length "4800")) (or ply_length (setq ply_length "2400"))
    1 point
  15. Off topic, but how does someone react to posts like I've seen in this thread? Lot of very useful posts here I'd love to give credit to.
    1 point
  16. I understand about the 45 degree increments but what I don't understand is why he only wants 0, 45 and 90? He has said that several times so I'm assuming he doesn't want 135, 180, 225, 270 and 315. I don't understand why those other angles are a problem? And I'm not even sure if a custom command will be able to do what he wants because those other angles are automatically generated when you initiate a 45 degree angle snap. Polar Tracking works great for me, but as you said, if he wants a true lock down of the cursor, he will have to get someone to help customize that.
    1 point
  17. Sadly, the help and forums for a lot of big CAD companies are very lacking. Job well done by CADTutor!
    1 point
  18. It's doable, but I wouldn't recommend it. The reason why is because you'll have to edit the actual architectural file itself, which isn't a problem in and of itself but this would get overridden when an update came through. Now, you did mention that a company is requiring you to do so. If this is the case, you need to have access to their architectural Revit model and place the openings yourself, and I doubt that's going to happen. Ultimately if you just want a literal opening, just use the Wall Opening tool found on the Architecture Ribbon:
    1 point
  19. It seems to be much better this morning dJE
    1 point
  20. I just checked the online user list and apparently it's just me and 182 ghosts, I mean guests. Lol By the way, I'm really liking this new drag and drop image upload functionality. So much easier and faster than the old way.
    1 point
  21. 1 point
  22. It works on my A2018... Although I modified it a little... I think the problem was in (vla-get-area) function - I replaced it with (vlax-curve-getarea)... :) (defun c:PTE ( / PTE:text-style PTE:layer PTE:ss->obj PTE:MinMax PTE:Text PTE:temp110919 PTE:start PTE:end *error* ss i sum lst rlst ss mm obj2 area txt react space pt ) (vl-load-com) ;;===========================================;; ;; Sub-02 Function ;; ;;===========================================;; (defun PTE:text-style ( na siz wid f1 f2 ) (if (not (tblsearch "STYLE" na)) (entmakex (list (cons 0 "STYLE") (cons 100 "AcDbSymbolTableRecord") (cons 100 "AcDbTextStyleTableRecord") (cons 2 na) (cons 70 0) (cons 40 siz) (cons 41 wid) (cons 50 0.0) (cons 71 0) (cons 42 siz) (cons 3 f1) (cons 4 f2) ) ) ) ) ;;===========================================;; ;; Sub-03 Function ;; ;;===========================================;; (defun PTE:layer ( la col lty / layer ) (while (not (tblsearch "layer" la)) (setq layer (vla-add (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) la ) ) (vla-put-color layer col) (vla-put-linetype layer lty) ) ) ;;===========================================;; ;; Sub-04 Function ;; ;;===========================================;; (defun PTE:ss->obj ( ss / i re ) (if ss (repeat (setq i (sslength ss)) (setq re (cons (vlax-ename->vla-object (ssname ss (setq i (1- i)))) re)) ) ) ) ;;===========================================;; ;; Sub-05 Function ;; ;;===========================================;; (defun PTE:MinMax ( ent / mi ma ylst xlst ans ) (cond ((= 'ENAME (type ent)) (vla-getboundingbox (vlax-ename->vla-object ent) 'mi 'ma) (setq ans (list (vlax-safearray->list mi) (vlax-safearray->list ma))) ) ((= 'VLA-OBJECT (type ent)) (vla-getboundingbox ent 'mi 'ma) (setq ans (list (vlax-safearray->list mi) (vlax-safearray->list ma))) ) ((= 'PICKSET (type ent)) (setq xlst '() ylst '() ) (mapcar '(lambda ( ename / mi ma ) (vla-getboundingbox (vlax-ename->vla-object ename) 'mi 'ma) (setq mi (vlax-safearray->list mi) ma (vlax-safearray->list ma) xlst (vl-sort (append xlst (list (car mi)) (list (car ma))) '<) ylst (vl-sort (append ylst (list (cadr mi)) (list (cadr ma))) '<) ) ) (vl-remove-if 'listp (mapcar 'cadr (ssnamex ent))) ) (setq ans (list (list (car xlst) (car ylst)) (list (last xlst) (last ylst)))) ) ) ans ) ;;===========================================;; ;; Sub-06 Function ;; ;;===========================================;; (defun PTE:Text ( pt str ag siz ) (setq obj (vla-addtext (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))) str (vlax-3d-point (trans pt 1 0)) siz)) (vla-put-alignment obj ag) ;10 middle 9 left (vla-put-textalignmentpoint obj (vlax-3d-point pt)) obj ) ;;===========================================;; ;; Sub-07 Function ;; ;;===========================================;; (defun PTE:temp110919 ( space pt title data __siz / _itemp i j tbstyle ) (defun _itemp ( collection item ) (if (not (vl-catch-all-error-p (setq item (vl-catch-all-apply 'vla-item (list collection item)) ) ) ) item ) ) (setq i 0 j 0) (vla-settextheight (setq tbstyle (_itemp (_itemp (vla-get-dictionaries (vla-get-activedocument (vlax-get-acad-object)) ) "ACAD_TABLESTYLE" ) (getvar 'CTABLESTYLE) ) ) acDataRow __siz ) (vla-settextheight tbstyle acHeaderRow __siz) (vla-settextheight tbstyle AcTitleRow __siz) ( (lambda ( table ) (vla-put-stylename table (getvar 'CTABLESTYLE)) (vla-settext table 0 0 title) ( (lambda ( row ) (mapcar (function (lambda ( rowitem ) (setq row (1+ row)) (setq i (1+ i)) ( (lambda ( column ) (mapcar (function (lambda ( item ) (if (= i (length data)) (setq item (strcat "{\\Fromans|c0;\\C30;" item "}")) (setq item (strcat "{\\Fromans|c0;\\C2;" item "}")) ) (vla-settext table row (setq column (1+ column)) item) (vla-setcellalignment table row column 5) ` ) ) rowitem ) ) -1 ) ) ) data ) ) 0 ) table ) ( (lambda ( textheight ) (setq aa textheight) (vla-addtable space (vlax-3d-point pt) (1+ (length data)) (length (car data)) (* 2 textheight) (* textheight (apply 'max (cons (/ (strlen title) (length (car data))) (mapcar 'strlen (apply 'append data)) ) ) ) ) ) (vla-gettextheight tbstyle acDataRow) ) ) ) ;;===========================================;; ;; Sub-08 Function ;; ;;===========================================;; (defun PTE:start ( variable-list / ) (setq *list* variable-list) (setq *start* (mapcar 'getvar *list*)) (if (= 8 (logand 8 (getvar 'UNDOCTL))) (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) ) (vla-startundomark (vla-get-activedocument (vlax-get-acad-object))) ) ;;===========================================;; ;; Sub-09 Function ;; ;;===========================================;; (defun PTE:end nil (if (and *list* *start*) (mapcar 'setvar *list* *start*)) (setq *list* nil *start* nil) (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) ) ;;===================================================;; ;; M A I N - function ;; ;;===================================================;; (defun *error* ( s ) (PTE:end) (princ)) (PTE:start '("dimzin")) (PTE:layer "2" 2 "continuous") (PTE:text-style "PTE-text" 0 1 "ROMANS.SHX" "GHS.SHX") (setvar 'cmdecho 0) (setvar 'dimzin 0) (setq i 0 sum 0. lst '() rlst '() ss (PTE:ss->obj (ssget "_:L" '((0 . "LWPOLYLINE,CIRCLE")))) ) (setq __siz (cond ( (getreal (strcat "\n Enter text size. <" (rtos (setq __siz (cond ( __siz ) ( 3. )) ) 2 1 ) ">: " ) ) ) ( __siz ) ) ) (setq __zin (cond ( (getint (strcat "\n Enter decimal point factor. <" (itoa (setq __zin (cond ( __zin ) ( 2 )) ) ) ">: " ) ) ) ( __zin ) ) ) (foreach obj ss (setq mm (PTE:MinMax obj) obj2 obj area (vlax-curve-getarea obj) sum (+ area sum) ) (setq txt (PTE:Text (mapcar '/ (mapcar '+ (car mm) (cadr mm)) (list 2 2)) (strcat (itoa (setq i (1+ i))) "-" (rtos area 2 __zin)) 10 __siz ) ) (vla-put-layer txt "2") (vla-put-stylename txt "PTE-text") (setq react (vlr-pers (vlr-object-reactor (list obj2) (list txt i) '( (:vlr-modified . PTE:area-reactor-m) (:vlr-erased . PTE:area-reactor-e) ) ) ) ) (setq rlst (append rlst (list react))) (setq lst (append lst (list (list (itoa i) (rtos area 2 __zin))))) ) (if (vlax-method-applicable-p (setq space (vlax-get-property (setq doc (vla-get-activedocument (vlax-get-acad-object))) (if (= 1 (getvar 'CVPORT)) 'Paperspace 'Modelspace) ) ) 'AddTable ) (progn (setq lst (append lst (list (list "ToTal" (rtos sum 2 __zin))))) (setq tobj (PTE:temp110919 space (setq pt (getpoint "\nPick the point for table")) "{\\Fromans|c0;\\C3;Area Table}" lst __siz ) ) (mapcar '(lambda ( re ) (vlr-data-set re (append (vlr-data re) (list tobj __zin)) ) ) rlst ) ) (princ "\n** This cad ver. don't service table. **") ) (PTE:end)(princ) ) ;;===========================================;; ;; CallBack Func. - 01 ;; ;;===========================================;; (defun PTE:area-table-arrange ( reactor area zin / table sum i ) (defun PTE:Mtext ( txt / len1 len2 ) (while (and (setq len1 (vl-string-search "\;" txt)) (setq len2 (vl-string-search "\\" txt)) ) (setq len1 (1+ len1) len2 (1+ len2) txt (vl-string-subst "" (substr txt len2 (1+ (- len1 len2))) txt) ) ) (while (and (setq len1 (vl-string-search "{" txt)) (setq len2 (vl-string-search "}" txt)) ) (setq txt (vl-string-subst "" "{" txt) txt (vl-string-subst "" "}" txt) ) ) txt ) ;;;__ (setq table (caddr (vlr-data reactor)) sum 0 i 0 ) (if (not (vlax-erased-p table)) (progn (vla-settext table (itoa (cadr (vlr-data reactor))) 1 (strcat "{\\Fromans|c0;\\C2;" area "}")) (repeat (- (vla-get-rows table) 2) (setq i (1+ i)) (setq sum (+ sum (atof (PTE:Mtext (vla-gettext table i 1))))) ) (vla-settext table (- (vla-get-rows table) 1) 1 (strcat "{\\Fromans|c0;\\C30;" (rtos sum 2 zin) "}")) ) ) ) ;;===========================================;; ;; CallBack Func. - 02 ;; ;;===========================================;; (defun PTE:area-reactor-m ( owner reactor param / zin area txt ) (if (not (vlax-erased-p owner)) (progn (setq zin (cadddr (vlr-data reactor)) area (rtos (vlax-curve-getarea owner) 2 zin) ) (if (not (vlax-erased-p (setq txt (car (vlr-data reactor))))) (vla-put-textstring txt (strcat (itoa (cadr (vlr-data reactor))) "-" area)) ) (PTE:area-table-arrange reactor area zin) ) )(princ) ) ;;===========================================;; ;; CallBack Func. - 03 ;; ;;===========================================;; (defun PTE:area-reactor-e ( owner reactor param / ) (setq zin (cadddr (vlr-data reactor))) (PTE:area-table-arrange reactor "-" zin) (vlr-remove reactor) (princ) ) Regards, M.R. HTH.
    1 point
×
×
  • Create New...