Recent Posts

Pages: 1 ... 5 6 [7] 8 9 10
61
AutoLISP (Vanilla / Visual) / Switching a bad plot device to a good plot device.
« Last post by cyclops on April 26, 2024, 11:20:22 AM »
Is there a way with a lisp routine to change the current defuncted plot device named "defuncted.pc3" to DWG to PDF.pc3.

I keep getting this warning when plotting.

DEFUNCTED.pc3: This plotter configuration cannot be used for one of these reasons:
the driver cannot be found, the device cannot be found, or the driver has a problem.
The None plot device has been substituted
.


Thanks,
Cy
62
AutoLISP (Vanilla / Visual) / Re: [request] Radiant Pipe Layout
« Last post by JohnK on April 26, 2024, 10:35:48 AM »
I just remembered a comment one of them made. They blindly asked if we could find something on github and if IT could help if we did. Now I wonder how all that's handled (most of the stuff on github doesn't even have a license or is GPL3 or BSD2). How/who takes liability in those cases? ...and what happens if the code is in python or delphi, or whatever and they'd need to install a 3rd party lib; does the process start over at that point?
63
AutoLISP (Vanilla / Visual) / Re: [request] Radiant Pipe Layout
« Last post by It's Alive! on April 26, 2024, 10:19:53 AM »
"Does it talk to the internet"
Oh, I had to make one of those for my app on the store. “This application may attempt to access other devices on your network..”  :lmao:
64
AutoLISP (Vanilla / Visual) / Re: Modify DWGUNITS
« Last post by ScottMC on April 26, 2024, 09:55:58 AM »
With my ancient A2K, this works: (setvar "LUNITS" 2) <- for decimal
65
AutoLISP (Vanilla / Visual) / Re: [request] Radiant Pipe Layout
« Last post by JohnK on April 26, 2024, 09:45:48 AM »
I know legal was on the meeting (didn't say much), but they did say something about "indemnity". But I wonder if our legal wanted a section of their EULA updated.
https://www.avenir-online.com/AvenirWeb/LoopCAD/LoopCADEULA.aspx

But I'm not sure how that even applies because it's just an application that produces output. We assume liability when we "send the final product out" (-i.e. it is up to us to verify the information is correct before we sign the drawings).

I got the impression that IT couldn't get answers about "security". I imagine questions like: "does it talk to the internet", "where/what/who", etc. and they wouldn't give an answer (or gave the wrong one).

The meeting was short and basically was telling me I may want to find an alternative.

66
AutoLISP (Vanilla / Visual) / Re: [request] Radiant Pipe Layout
« Last post by It's Alive! on April 26, 2024, 09:21:07 AM »
I’m interested in what types of questions your organization would ask with regards to ‘security’ and ‘Legal’ things. 
I know I'm not setup for enterprise clients, I always thought, 500 seats and you get the source under NDA,
5 and I’d just say, sorry, I’m not setup for that.  :crazy2:
I guess the bigger companies are doomed to stall productivity with bureaucracies   
Could be a topic for another thread…
67
AutoLISP (Vanilla / Visual) / Re: [request] Radiant Pipe Layout
« Last post by JohnK on April 26, 2024, 07:56:11 AM »
I just evaluated LoopCAD and put in a purchase request. It was denied because apparently, they would not even discuss "security" and other things with Legal and IT. My request was denied.
None of my business, but… what did they say? Like no answer or ..Go away or I shall taunt you a second time! 

I don't know either really, But I got the impression that they basically hung up the phone (so to speak). I got a lot of "They refuse", "I highly doubt", and "Do you have any other software ideas". 
68
Keep the blocks on the polyline and delete other blocks within the tolerance on both sides of the line

issue:

https://www.cadtutor.net/forum/topic/78798-selection-of-blocks-that-have-their-point-of-origin-in-a-polygon-avoiding-other-blocks-with-the-same-name-but-that-still-overlap-a-little-in-the-polygon/#comment-625827

Colleagues, best regards. Today I come to ask for help. I have developed a routine that splits a polygon based on the location of the origin of the blocks above it; However, the selection takes into account other blocks that overlap only slightly in the polygon, allowing me to run the routine anyway but with an undesired result.
I can remove the blocks manually, but when there are too many it becomes very tedious and time-consuming. I want to know if there is a way to avoid these external blocks that alter the results of my routine.
In the attached dwg I present 2 cases, in the one on the right the routine works without problems, however in the one on the left the complication occurs with the blocks external to the polygon but that still overlap a little.
Another complication that arises is when the polygon presents an arc.

=============================================

Code: [Select]
(defun c:xdtb_pl_tolerase (/ E typ blkname ss fence-box plane)
  (xd::doc:getdouble
    (xdrx-string-multilanguage
      "\n搜索范围"
      "\nSearch range tolerance"
    )
    "#xd-var-global-search-tol"
    (xd::doc:getpickboxheight)
  )
  (xd::doc:getdouble
    (xdrx-string-multilanguage
      "\n点线容差精度"
      "Point and line tolerance"
    )
    "#xd-var-global-tol-dist"
    (xdrx-getvar "equalpoint")
  )
  (if (and (setq e (car (xdrx-entsel
  (xdrx-string-multilanguage
    "\n拾取特征图元类型<退出>:"
    "\nPick feature entity type<Exit>:"
  )
)
   )
   )
   (setq typ (assoc 0 (entget e))
blkname (xdrx-getpropertyvalue e "name")
   )
   (setq ss (xdrx-ssget
      (xdrx-string-multilanguage
"\n选择多段线<退出>:"
"\nSelect Polyline<Exit>:"
      )
      '((0 . "*polyline"))
    )
   )
      )
    (progn
      (xdrx-begin)
      (mapcar
'(lambda (x)
   (if (and (setq fence-box (xdrx-getpropertyvalue
      x
      "tofence"
      #xd-var-global-search-tol
      1
    )
    )
    (setq fence-box (xdrx-getsamplept fence-box))
    (setq
      ss1 (ssget "cp"
fence-box
(list typ)
  )
      ss2 (ssget "f" (xdrx-getsamplept x) (list typ))
    )
       )
     (progn
       (setq nums  0
     plane (xdrx-getpropertyvalue x "plane" t)
       )
       (mapcar '(lambda (y)
  (setq position (xdrx-getpropertyvalue
   y
   "position"
)
closest (xdrx-getpropertyvalue
   x
   "getclosestpointto"
   position
)
position (xdrx-point-orthoproject position plane)
closest (xdrx-point-orthoproject closest plane)
  )
  (if (not (equal closest position #xd-var-global-tol-dist))
    (progn
      (setq nums (1+ nums))
      (xdrx-entity-delete y)
    )
  )
)
       (xdrx-ss->ents ss1)
       )
       (xdrx-prompt
(xdrx-string-formatex
   (xdrx-string-multilanguage
     "\n共删除了 %d 个容差范围内的不在多段线线上的图块."
     "\nA total of %d tiles matching the feature criteria were deleted."
   )
   nums
)
       )
     )
   )
)
(xdrx-ss->ents ss)
      )
      (xdrx-end)
    )
  )
  (princ)
)
69
AutoLISP (Vanilla / Visual) / Re: "ssget everything" for a single point?
« Last post by JasonB on April 26, 2024, 06:22:58 AM »
In BricsCAD (ssget "_+.:E:S") does a single selection, acting like Entsel but will select everything under the cursor.

I also created the attached that does the same thing using a crossing polygon. The PICKBOXCOORD funtion returns a set of coordinates centred on the pick point and relative to the current pickbox size than can be used to define the crossing polygon.

Code - Auto/Visual Lisp: [Select]
  1. ;; PICKBOXCOORD
  2. ;; Pick Box Coordinates
  3. ;; Returns coordinates (list of 4 points defining a square) that are planar to the current display view, relative to the current pickbox size, and centred about the given point.
  4. ;; the given centre point must be in WCS
  5. ;; returned points are also in WCS
  6. ;; Includes an option to apply a scale factor to the current PICKBOX value.
  7. ;;
  8. ;; e.g for
  9. ;; (setvar 'PICKBOX 6) and in plan view
  10. ;; (PICKBOXCOORD (trans (getpoint) 1 0) 1)
  11. ;; ((72.0287613899495 74.940245442679 0.0) (72.0287613899495 75.8325809183257 0.0) (72.9210968655962 75.8325809183257 0.0) (72.9210968655962 74.940245442679 0.0))
  12. ;; (PICKBOXCOORD '(0 0 0) 1)
  13. ;; ((-0.446167737823339 -0.446167737823339 0.0) (-0.446167737823339 0.446167737823339 0.0) (0.446167737823339 0.446167737823339 0.0) (0.446167737823339 -0.446167737823339 0.0))
  14. ;; (PICKBOXCOORD '(0 0 0) 10)
  15. ;; ((-4.46167737823339 -4.46167737823339 0.0) (-4.46167737823339 4.46167737823339 0.0) (4.46167737823339 4.46167737823339 0.0) (4.46167737823339 -4.46167737823339 0.0))
  16.  
  17. (defun PickBoxCoord ( pctr factor / ratio pbox2)
  18.         ;;VIEWSIZE ; Current height of the viewport in drawing units
  19.         ;;SCREENSIZE ; x,y size of the viewport in pixels
  20.         (if (not factor) (setq factor 1))
  21.         (setq ratio (/ (getvar 'VIEWSIZE) (cadr (getvar 'SCREENSIZE)))) ; ratio between drawing units and pixels
  22.         (setq pbox2 (* (getvar 'PICKBOX) ratio 0.5 factor)) ; get 1/2 the current pickbox size in drawing units and apply factor if given
  23.         (setq pctr (trans pctr 0 2)) ; convert the given point to display coordinates
  24.         ;; Create a point list of each of the four corners
  25.         (mapcar '(lambda (pts) (trans pts 2 0))
  26.                         (list
  27.                                 (list (- (car pctr) pbox2) (- (cadr pctr) pbox2) (caddr pctr)) ; bottom left corner
  28.                                 (list (- (car pctr) pbox2) (+ (cadr pctr) pbox2) (caddr pctr)) ; top left corner
  29.                                 (list (+ (car pctr) pbox2) (+ (cadr pctr) pbox2) (caddr pctr)) ; top right corner
  30.                                 (list (+ (car pctr) pbox2) (- (cadr pctr) pbox2) (caddr pctr)) ; bottom right corner
  31.                         )
  32.         )
  33. )
  34.  

SSET Usage Example

Code - Auto/Visual Lisp: [Select]
  1. ;; PICKBOXSSET
  2. ;; Pick Box Selection Set
  3. ;; Creates a crossing box selection set based on the current pickbox size
  4. ;; relative to the given pick box centre point (in WCS)
  5. ;; returns a selection set if entities are found.
  6. ;; If not nil the factor will be applied to size of the current pickbox.
  7. ;;
  8.  
  9. ;; (PICKBOXSSET (trans (getpoint) 1 0) 1)
  10.  
  11. (defun PickBoxSSet ( pctr factor )
  12.         (ssget "_CP" (PICKBOXCOORD pctr factor))
  13. )

Test to visualise the selection box created by PICKBOXCOORD

Code - Auto/Visual Lisp: [Select]
  1. ;; DRAWPICK
  2. ;; Test of PICKBOXCOORD
  3. ;; Creates a 3DPOLY about the selected point
  4. ;; This should always be planar to the current display
  5.  
  6.  
  7. (defun C:DrawPick ( / pt gext coord)
  8.  (setq pt (getpoint "\nPick a point: "))
  9.  (cond (pt
  10.                         (setq pt (trans pt 1 0)) ; convert point to WCS
  11.                         (setq gext (PICKBOXCOORD pt 10))
  12.                                 (entmake
  13.                                                 (list
  14.                                                         '(0 . "POLYLINE")
  15.                                                         '(100 . "AcDbEntity")
  16.                                                         '(100 . "AcDb3dPolyline")
  17.                                                         '(70 . 9) ; 8 = 3DPOLY, 9 = Closed 3DPOLY
  18.                                                 )
  19.                                 )
  20.                                 (foreach coord gext
  21.                                         (entmake
  22.                                                 (list
  23.                                                         '(0 . "VERTEX")
  24.                                                         '(100 . "AcDbEntity")
  25.                                                         '(100 . "AcDbVertex")
  26.                                                         '(100 . "AcDb3dPolylineVertex")
  27.                                                         '(70 . 32)
  28.                                                         (cons '10 coord) ; Coordinate needs to be a list in the form (10 x y z)
  29.                                                 )
  30.                                         )                              
  31.                                 )
  32.                                 (entmake '((0 . "SEQEND")))
  33.                 )
  34.  )
  35.  (prin1)
  36. )
70
AutoLISP (Vanilla / Visual) / Re: "ssget everything" for a single point?
« Last post by xdcad on April 26, 2024, 05:56:30 AM »
Provide an idea:

Erase completely overlapping (coincide) objects and keep one

https://www.theswamp.org/index.php?topic=59483.0

Pages: 1 ... 5 6 [7] 8 9 10