Recent Posts

Pages: [1] 2 3 ... 10
1
AutoLISP (Vanilla / Visual) / Re: Help with a Block Search program
« Last post by Master_Shake on Today at 08:56:47 AM »
The standard insert dialog is not sufficient?
2
AutoLISP (Vanilla / Visual) / Re: Triangulation (re-visited)
« Last post by pawcyk on Today at 04:46:56 AM »
Hi everyone.
Can enyone check this file. In my opinion function PROF works wrong with this settings.

pawcyk
3
Thank you once again.
4
AutoLISP (Vanilla / Visual) / Re: Getting a Layer Name
« Last post by MeasureUp on May 20, 2018, 09:42:27 PM »
Appreciate your inputs. Thanks guys.
5
I have the program below that opens ODS spreadsheets and I need to have a list of the sheets.

Code: [Select]
(DEFUN C:TEST ()
(VL-LOAD-COM)
(setq fileName "c:\\test.ODS")
(setq oCalc    (ooffice_calc_open filename))
(setq oSheets  (vl-catch-all-apply 'vlax-invoke-method (list oCalc 'getSheets)))
;
;(setq lsheets ...);list of osheets
;(print lsheets)
;
(vl-catch-all-apply 'vlax-invoke-method (list oCalc 'Dispose))
(princ)
)
;...
(defun ooffice_calc_open ( filename / strDocType strVer strNam strFile oDesktop oService oStruct oCalc arrProps)
 (if (and ;; check if OOffice is installed
      (setq strDocType "StarCalcDocument")
      (setq strVer (vl-registry-read (strcat "HKEY_CLASSES_ROOT\\soffice." strDocType "\\CurVer")))
      (setq strNam (vl-registry-read (strcat "HKEY_CLASSES_ROOT\\" strVer)))
      (setq strFile (vl-registry-read (strcat "HKEY_CLASSES_ROOT\\" strVer "\\protocol\\StdFileEditing\\server")))
      (findfile strFile)
     )
     (progn
      (setq oService (vlax-get-or-create-object "com.sun.star.ServiceManager"))
      (setq oDesktop (vlax-invoke-method oService "createInstance" "com.sun.star.frame.Desktop"))
      (setq oStruct (vlax-invoke-method oService "Bridge_GetStruct" "com.sun.star.beans.PropertyValue"))
      (vlax-put-property oStruct "Name" "Show")
      (vlax-put-property oStruct "Value" :vlax-true)
      (setq arrProps (vlax-make-safearray vlax-vbvariant (cons 0 0)))
      (vlax-safearray-put-element arrProps 0 oStruct)
      (setq filename (strcat "file:///" (vl-string-translate "\\" "/" FileName)))
      (setq oCalc (vlax-invoke-method oDesktop "LoadComponentFromURL" filename  "_blank" 0 arrProps))
      (vlax-release-object oStruct)
      (vlax-release-object oDesktop)
      (vlax-release-object oService)
     )
 )
 oCalc
)
6
AutoLISP (Vanilla / Visual) / Re: Group objects based on angle and rotation
« Last post by roy_043 on May 20, 2018, 02:45:07 PM »
Good to hear that.
I have made a small change to the code in my previous post. On line 34 I have changed ang to (car fnd). This is more consistent.
7
AutoLISP (Vanilla / Visual) / Re: Group objects based on angle and rotation
« Last post by Coder on May 20, 2018, 09:59:49 AM »
Hello roy.

This is awesome and great work , thank you so much.

Have a great weekend.
8
AutoLISP (Vanilla / Visual) / Re: Group objects based on angle and rotation
« Last post by roy_043 on May 20, 2018, 06:47:36 AM »
Code - Auto/Visual Lisp: [Select]
  1. ; (setq lst (GroupInsert_RotationAlignment (ssget)))
  2. ; The function groups inserts based on their rotation angle and alignment.
  3. ;   Two inserts are considered aligned if the angle of the line
  4. ;   connecting their insertion points matches their rotation angle.
  5. ; Return value: List with this format:
  6. ; ((angle insPt enm enm ... enm) (angle insPt enm enm ... enm) ...)
  7. (defun GroupInsert_RotationAlignment (ss / ang fnd i obj pt ret)
  8.  (if ss
  9.    (repeat (setq i (sslength ss))
  10.      (setq obj (vlax-ename->vla-object (ssname ss (setq i (1- i)))))
  11.      (if (= "AcDbBlockReference" (vla-get-objectname obj))
  12.        (progn
  13.          (setq ang (vla-get-rotation obj))
  14.          (setq pt (vlax-get obj 'insertionpoint))
  15.          (if
  16.            (setq fnd
  17.              (vl-some
  18.                '(lambda (sub)
  19.                  (if
  20.                    (and
  21.                      (equal ang (car sub) 1e-8)
  22.                      (or
  23.                        (equal pt (cadr sub) 1e-8)
  24.                        (equal ang (angle pt (cadr sub)) 1e-8)
  25.                        (equal ang (angle (cadr sub) pt) 1e-8)
  26.                      )
  27.                    )
  28.                    sub
  29.                  )
  30.                )
  31.                ret
  32.              )
  33.            )
  34.            (setq ret (subst (vl-list* (car fnd) (cadr fnd) (vlax-vla-object->ename obj) (cddr fnd)) fnd ret))
  35.            (setq ret (cons (list ang pt (vlax-vla-object->ename obj)) ret))
  36.          )
  37.        )
  38.      )
  39.    )
  40.  )
  41. )
9
Land Lubber / Geographically Positioned / Re: Availability
« Last post by Dent Cermak on May 19, 2018, 11:30:13 PM »
MJ, you are all into software with the approach of teaching and helping people and perhaps selling a copy or two of the software.
Perhaps it is time for you to go over to the "Dark Side"?
I am in a similar situation except I got cut off at the knees at age 70. That leads to very uncomfortable feelings.
What I am trying to do now is to open my own business teaching, installation, configuration, customization plus drafting on the side and now selling the software. I work out of my "home office".
The aforesaid "Dark Side" is Carlson software. I push the AutoCAD Embedded version. It's a slow start, but I can see it coming together.
Email Scott Griffin at sgriffin@carlsonsw.com and see what he has to offer. They have offered me a honey deal on software sales and I get to do all the training I want with the people I sell the software to.
If you think it may help. you can use me as a reference. Tell Scott I sent you.
10
AutoLISP (Vanilla / Visual) / Re: Group objects based on angle and rotation
« Last post by Coder on May 19, 2018, 11:59:54 AM »
I do not understand. The list already contains the rotation angles (in radians).
((angle1 ename ename ...) (angle2 ename ename ...) ...)

Thank you for your kind reply.

This is my goal of the codes as drawn in the image down and sorry for the confusion.
Pages: [1] 2 3 ... 10