- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Yes, the title as confusing as it sounds, the code I have wrote, does not work.
A quick background so you can understand the code, I am a Land Surveyor and I have made a code where when we use a 3D delivery, we can use this code. When we have the exact cover level, it extracts the z-value of that and allows the user to enter the pipe depth and reduces the z-value of that pipe line to its new.
(I decided to reduce it to a AutoLisp code because otherwise you will have to go through ID the pipe line and knowing which point (start or end) it is then using a calculator to work out the pipe line new z-value and then going into properties and changing it)
The problem is that the AutoLisp routine does not work as it should, my main two lines that are not working are lines 19 and 31 where it starts with the If statements and its condition, the condition output is 'nil'. I have even put in the command prompt in AutoCAD: (= var1 var2) (using the respected variables) and the output is still 'nil'. Every other line works, and the code within the 'if' routine works too when entered one by one manually, however, its just that the 'if' statement does not trigger.
I have attached the file below, the command won't present 'nil' anymore when you are running the code as I have put a "Not a start/end" point prompt, but after running the code, type in the command line in AutoCAD: (= pt spoint) <or> (= pt epoint) where you will see the error. I might have a rough idea of what it can be, could it be the way I am getting the variables that the spoint/epoint variable are a different type compared to the pt as I used the (getpoint) for one and the (entget) for another? No idea, just throwing my thoughts that I can't seem to solve.
Thank you!
Solved! Go to Solution.