Author Topic: Alternative to the FILLET command in vlisp  (Read 4041 times)

0 Members and 1 Guest are viewing this topic.

Lupo76

  • Bull Frog
  • Posts: 343
Alternative to the FILLET command in vlisp
« on: October 04, 2019, 09:35:47 AM »
Hello to all,
I am using the following line of code to fillet all the vertices of a polyline

Code: [Select]
(command "_.fillet" "_r" DIA "_.fillet" "_p" oggpoli)

unfortunately in my context with the reactos it doesn't work because I can't use the "command" function.
Is there a way to use fillet without "command" and without "vl-cmdf"?

Thank you in ancient times

Augusto

  • Newt
  • Posts: 75
Re: Alternative to the FILLET command in vlisp
« Reply #1 on: October 04, 2019, 10:08:01 AM »
Maybe Lee-Mac can help you with this task.

http://lee-mac.com/bulgeconversion.html

ChrisCarlson

  • Guest
Re: Alternative to the FILLET command in vlisp
« Reply #2 on: October 04, 2019, 10:19:57 AM »
Are you trying to automagically create filleted entities? Simply replace the XX with your units of radius.

Source here

Code - Auto/Visual Lisp: [Select]
  1. (defun C:PLF ()
  2.   (command "_PLINE")
  3.   (while (= 1 (getvar "cmdactive"))
  4.     (command pause))
  5.   (vl-cmdf "._FILLET" "P" "R" [b]XX[/b] "L")
  6.   (princ)
  7. )
  8.  

Lupo76

  • Bull Frog
  • Posts: 343
Re: Alternative to the FILLET command in vlisp
« Reply #3 on: October 04, 2019, 11:24:30 AM »
Are you trying to automagically create filleted entities? Simply replace the XX with your units of radius.

Source here

Code - Auto/Visual Lisp: [Select]
  1. (defun C:PLF ()
  2.   (command "_PLINE")
  3.   (while (= 1 (getvar "cmdactive"))
  4.     (command pause))
  5.   (vl-cmdf "._FILLET" "P" "R" [b]XX[/b] "L")
  6.   (princ)
  7. )
  8.  

As I wrote I can't use "command" and "vl-cmdf" in my context with reactors....

Lupo76

  • Bull Frog
  • Posts: 343
Re: Alternative to the FILLET command in vlisp
« Reply #4 on: October 04, 2019, 11:27:29 AM »
Maybe Lee-Mac can help you with this task.

http://lee-mac.com/bulgeconversion.html

mmmmmm....I don't understand how it can be useful to solve my problem.
I look for a vlisp function that without using "command" converts the sharp edges of a polyline to arcs.

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Alternative to the FILLET command in vlisp
« Reply #5 on: October 04, 2019, 01:14:10 PM »
Is there a way to use fillet without "command" and without "vl-cmdf"?

You will need to write your own fillet command...

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: Alternative to the FILLET command in vlisp
« Reply #6 on: October 05, 2019, 09:11:11 PM »
As Lee says and he helped me you can write a direct command to the command line I have Circle fillet and offset.

eg f123 will start fillet command and set radius to 123 the radius can be any value, a c100 is a circle of 100 radius.

It uses a reactor and checks what error has occurred as if you type c45 it will return unknown command c45.

The method is limited to say 26 plus say ten individual versions as it looks at 1st character of the error.

« Last Edit: October 06, 2019, 09:38:05 PM by BIGAL »
A man who never made a mistake never made anything

lamarn

  • Swamp Rat
  • Posts: 636
Re: Alternative to the FILLET command in vlisp
« Reply #7 on: October 06, 2019, 04:55:55 PM »
The code is not working

VLA-OBJECT nil

shouldn't obj be defined in the first few lines?
Design is something you should do with both hands. My 2d hand , my 3d hand ..

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: Alternative to the FILLET command in vlisp
« Reply #8 on: October 06, 2019, 09:39:05 PM »
 Sorry as I cut this out of a bigger routine I left in a couple of redundant lines. I have updated the code above.

Note as it uses reactors you can not use a decimal point in the values but there is a work around 45-6 is = 45.6 just use the "-" for a decimal.
« Last Edit: October 06, 2019, 09:42:07 PM by BIGAL »
A man who never made a mistake never made anything

Dlanor

  • Bull Frog
  • Posts: 263
Re: Alternative to the FILLET command in vlisp
« Reply #9 on: October 07, 2019, 03:01:40 AM »
If you think of a polyline as a road alignment and filleting with a radius as inserting a curve between straight road sections with a given radius, the problem becomes

calculate delta angle
calculate tangent lengths
calculate chord points : tangent to curve = distance to IP - tan length and curve to tangent distance to IP + tan length. (vlax-curve-getpointatdist)
delete ip (old vertex)
insert new vertices (chord points)
calculate bulge and apply at TC

https://knowledge.autodesk.com/support/civil-3d/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/Civil3D-UserGuide/files/GUID-0B06FB2D-945F-4526-89D8-07820E78FF6C-htm.html

ChrisCarlson

  • Guest
Re: Alternative to the FILLET command in vlisp
« Reply #10 on: October 08, 2019, 10:33:41 AM »
Are you trying to automagically create filleted entities? Simply replace the XX with your units of radius.

Source here

Code - Auto/Visual Lisp: [Select]
  1. (defun C:PLF ()
  2.   (command "_PLINE")
  3.   (while (= 1 (getvar "cmdactive"))
  4.     (command pause))
  5.   (vl-cmdf "._FILLET" "P" "R" [b]XX[/b] "L")
  6.   (princ)
  7. )
  8.  

As I wrote I can't use "command" and "vl-cmdf" in my context with reactors....

So what is your context? What are you trying to accomplish? What is your end goal?