Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/02/2021 in all areas

  1. All members (i.e. anyone with a post count of 10 or greater) now have access to a new theme here at the CADTutor forum. This has been a long-time request, and now it's here! In the footer of every page, eligible members will see a "Theme" link that allows a choice of the default CADTutor theme or the new Dark Mode theme. Simply choose the one you prefer. The forum will remember your choice until you change it. Try it out and let me know what you think
    1 point
  2. One more for fun - (reverse (cons (reverse (cons 'z3 (reverse (last lst)))) (cdr (reverse lst))))
    1 point
  3. The above responses should get you most of the way there - I would personally approach the problem in the following way: Attempt to obtain a selection set of all circles in the drawing using the ssget function, using the X mode string (to query the entire drawing database) and an appropriate filter list to select entities with entity type (DXF group 0) equal to CIRCLE - examples of this may be found as part of my ssget reference here. Use an if or cond statement to test whether the value returned by the ssget expression is a valid selection set or nil (if no circles could be found), and notify the user if the latter. Prompt the user using the getdist function to specify the width of the line (you could even offer a default option [extra points!] by following my tutorial here) Use an if or cond statement to test whether the user has specified a valid value and either assign a default value or exit the program if the user has pressed Enter/Space/right-click at the prompt. With all input acquired, iterate over the selection set using one of the methods described in my tutorial here. For each circle entity encountered, obtain the DXF data using the entget function. Obtain the circle center (DXF group 10) and radius (DXF group 40) using the assoc function, and use the cdr function to obtain the value associated with these DXF groups. Use the polar function to calculate a point from the center, at a distance equal to the radius, in the desired direction. Use the polar function to calculate a second point either relative to the center (and therefore at a distance equal to the radius) or to the first point (and therefore at a distance equal to twice the radius), in the opposite direction. Construct a 2D Polyline between these two points with constant width equal to that specified by the user - to create the polyline, you can proceed in three different ways: Call the PLINE command using the command function, accounting for the effect of Object Snap and regional differences in command names & keyword options (by prefixing commands and options with an underscore). Use entmake/entmakex to write to the drawing database directly, supplying the appropriate DXF groups for an LWPOLYLINE entity. Use the ActiveX addlightweightpolyline method to create an AcDbPolyline VLA object, and then change the ConstantWidth property to that specified by the user.
    1 point
  4. Hi Dave, The point I was trying to make, we've seen it happen when the user hasn't changed anything from standard, just copied/pasted (or quoted) something from elsewhere. I can't give you a workable link to this post because it's from the private 'staff' area of the CCleaner forum, but it shows it happening. There is actually bold black 'standard' text, in that first 'box' when viewed in normal mode, but in dark mode the forum renders it as white on white. Investigating further the source HTML shows the text colour specified as: 'color:var(--c9)' So because the text colour is called as a variable the Invision software has changed the 'standard' text colour to render as white for viewing in dark mode, but it hasn't changed the background because that is specified as 'background-color:#ffffff' and not as a variable. The second text is specificallly set to 'color:#475576' and so isn't automatically changed for dark mode. The background is also specified as #ffffff. The original poster said: I believe that he had composed it in a word processor and then copied/pasted it into the forum editor. As I said above it doesn't happen often but can happen if you copy/paste something from elsewhere and so get a mixture of specific colour settings and variables. It's just something to be aware of, especially if you use a word processor to compose your posts. For comparison here is the original post in normal mode:
    1 point
  5. I will write it this way. (defun c:txtswap (/ sel lst) (and (princ "\nSelect two text objects to swap: ") (setq sel (ssget "_:L" '((0 . "*TEXT")))) (or (= (sslength sel) 2) (alert "Must select two text objects only <!>") ) (setq lst (mapcar '(lambda (x) (vlax-ename->vla-object (ssname sel x))) '(0 1))) (mapcar 'vla-put-textstring (reverse lst) (mapcar 'vla-get-textstring lst)) ) (princ) ) (vl-load-com)
    1 point
×
×
  • Create New...