Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Nice indeed Stefan

I had the add vertex worked out in plain autolisp in my mind.  But for straight segments only.  This is 1 of the times that vla and vlax would be almost mandatory.  -David
12
I do not know if this can be interesting but there are three cases for which a polyline can be closed:
Code: [Select]
; ALE_Pline_LwClosedP - Version: 1.01
;
; Return Values:
;   nil if LwPolyline is Open                         
;   1   if is Closed - (or logand 1 flag 70 is True) 
;   2   if is Open   BUT startpoint is equal endpoint   
;   3   if is Closed AND startpoint is equal endpoint   
;
; Example:
;  (ALE_Pline_LwClosedP (vlax-ename->vla-object (car (entsel "Poly: "))) 0.001)
;
(defun ALE_Pline_LwClosedP (LwPObj FuzFac)
  (cond
    ( (eq :vlax-true (vla-get-closed LwPObj))
      (if
        (equal
          (vlax-curve-getEndPoint LwPObj)
          (vlax-curve-getPointAtParam LwPObj (1- (vlax-curve-getEndParam LwPObj)))
        )
        3 1
      )
    )
    ( (equal (vlax-curve-getStartPoint LwPObj) (vlax-curve-getEndPoint LwPObj) FuzFac) 2 )
  )
)
13
Try it manually, hitting the end key does not do as your intending.
14
I think that before insert imagen must be collapse the range.
Invoke method Collapse

(mswm-Collapse *range* mswc-wdCollapseEnd)
or

(vlax-invoke-method range 'Collapse  mswc-wdCollapseEnd)

15
I have to insert a picture in the LAST page of a MS Word file, but in my code there's something wrong: the image is inserted at the beginning of the FIRST page.

This is the code:
Code - Auto/Visual Lisp: [Select]
  1. ;; init
  2. (setq app (vlax-get-or-create-object "Word.Application"))
  3. (vla-put-visible app :vlax-true)
  4. (vlax-put-property app 'ScreenUpdating :vlax-true)
  5. (setq docs (vlax-get-property app 'Documents))
  6. ;; open test file
  7. (vlax-invoke-method docs 'Open "c:\\test.doc" :vlax-false)
  8. (setq doc (vlax-get-property app 'Activedocument))
  9. (vlax-invoke-method doc 'Activate)
  10. ;;
  11. (setq selection (vlax-get-property app 'Selection ))
  12.  
  13. ;; set cursor in last page [here's the error ???]
  14. (vlax-invoke-method selection 'Endkey)
  15. ;; get image obiect
  16. (setq img (vlax-get-property selection 'InlineShapes))
  17. ;; insert  image
  18. (setq pic(vlax-invoke-method img 'AddPicture "c:\\test.gif"))
  19.  
  20. ; closing..
  21.  
  22. (vlax-invoke-method doc 'Saveas  "c:\\test.doc")
  23.  
the image is insert in first page :-(

Some idea ?
Thanx
16
AutoLISP (Vanilla / Visual) / Re: Invoke VLIDE via Lisp?
« Last post by Peter2 on Today at 04:47:52 am »
You can do a lisp compile directly without invoking vl-ide. ...
For me it works only as described above: VLIDE has to be invoked at least once (and can be closed again), then the command will do its job.

On a freshly started AutoCAD-session I get
Code: [Select]
Befehl: (vlisp-compile 'st "x.lsp")
; Fehler: no function definition: VLISP-COMPILE
when VLIDE was not started before.
17
.NET / Re: Create object
« Last post by gile on Today at 02:43:49 am »
Hi,

Assuming you're a ".net Beginner", you shouldn't start with such a complex task. your goal requires an intermediate AutoCAD .net programming level with 3D geometry.
18
.NET / Create object
« Last post by feesa on Today at 02:06:51 am »
Hi,

I am a .net Beginner,
I would be highly appericiated if any one Provide me a coding,
I need to creating a object from Geometric center of another object,
we have to ask user to select window, then from that window, I need to create polyline with angle given by the user,
I have attached a dwg for above description.

Thanks & Regards

feesa
19
AutoLISP (Vanilla / Visual) / Re: Polyline and Circle to one polyline
« Last post by Coder on Today at 01:07:08 am »
Hi Coder,
Try this lisp. The circles are positioned to the "right" of the polyline. For a clockwise closed polyline, that would be inside...

This is great Stefan.
The direction of circles is not important recently but the circle itself is the most needed at the mean time.

Thank you so much for your time and great efforts.
20
AutoLISP (Vanilla / Visual) / Re: Polyline and Circle to one polyline
« Last post by Stefan on February 19, 2017, 10:30:00 pm »
Thanks Lee

Funny thing, I always believed that the bulge is defined like in my lisp. Recently I read (in the Help file) that is 1/4 of the included angle, but I never used it like this.

You're right about m2p, thanks for the tip.
Pages: 1 [2] 3 4 ... 10