Code Red => AutoLISP (Vanilla / Visual) => Topic started by: ribarm on September 28, 2022, 09:53:15 AM
Title: Fix routine for further develop/testing...
Post by: ribarm on September 28, 2022, 09:53:15 AM
Hi, I need perhaps, if someone knows to fix this code in order to test/debug further one of routine related with network path(s) length marking / description... Checking routine is in folder .\network : lengths_along_pipe_trees.lsp...
Here is questioning code for fixing - second part (breakage into smaller arcs is not working) - checked point : p1/p2 vs reference arc entity - break point don't lie on reference arc - "circular path in its entirety" defined by the same arc orientation and position for unknown reasons...
(prompt"\nFor UNDO - type \"UNDO\" - \"Back\" option...")
(*error*nil)
)
If someone is willing to step in, I'll be very grateful... M.R.
Title: Re: Fix routine for further develop/testing...
Post by: ribarm on October 02, 2022, 05:02:19 AM
I get just slightly more arcs, but still not like it should be... Second part is problematic : under ;;; half circle arcs breakage to smaller composing arcs at their intersections ;;; comment...
(defun c:sphere_rnd-equatorial-circles_2_arcs (/*error* v^v process1 process2 osm ucsf ss i ci cix o r cc ccx vec p1 p2 arc1 arc2 arcs arcsp a1x a2x arcss aarcs )
(prompt"\nFor UNDO - type \"UNDO\" - \"Back\" option...")
(*error*nil)
)
Title: Re: Fix routine for further develop/testing...
Post by: ribarm on October 02, 2022, 06:25:15 AM
And just for info, since I gained little experience working on tree_branching *.lsp routines... Be careful in AutoCAD with (vlax-curve-getpointatdist) function... In my case distance was greater than overall length of curve and instead of throwing out nil as a result - output, in AutoCAD result was starting point of curve (in my case it was SPLINE, but that doesn't matter generally speaking)... BricsCAD was here fine and I hadn't have to work to overcome issue... All in all, as I had time, I've cobbled out working both codes in both environments... It's just that something not necessity happen to had to be written...
Title: Re: Fix routine for further develop/testing...
Post by: ribarm on October 02, 2022, 09:04:02 AM
I've figured out what was the issue... Only thing missing was (unit) sub function... I thought that cross product between 2 unit vectors inevitable produces unit vector as a result, but I was wrong... I've checked this and this is correct version... But, since, I've already worked on "lengths_along_pipe_trees.lsp" and tested it and on 3D arcs, now all works as desired... Just remember that when you apply it to network and pick crossing starting point, there must be free endings for which network is to be overdrawn with lengths, i.e. there must be no crossings at some places and no meetings with ending entity...
(defun c:sphere_rnd-equatorial-circles_2_arcs (/*error* unit v^v process1 process2 osm ucsf ss i ci cix o r cc ccx vec p1 p2 arc1 arc2 arcs arcsp a1x a2x arcss aarcs )