Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
AutoLISP (Vanilla / Visual) / Zoom to Geolocation Point
« Last post by MSTG007 on July 13, 2020, 07:53:30 AM »
I am having a hard time trying to create a basic macro or routine that can zoom to a center of a georeferenced point.

How can I get the location of the georeferenced point? I would like to be able to set the coordinate zone then zoom to the center of it.

Code: [Select]
(vl-load-com)

(defun c:test ()
 (setq p (getPositionMarkerCoords))
 (command "zoom" "center" (getPositionMarkerCoords) "200000")
 (princ)
 )

(defun getPositionMarkerCoords (  / ad s ds ts rp le ln p)
 (setq ad (_GetAeccDocument))
 (setq s (vlax-get-property ad 'Settings))
 (setq ds (vlax-get-property s 'DrawingSettings))
 (setq ts (vlax-get-property ds 'TransformationSettings))
 (setq rp (vlax-get-property ts 'ReferencePoint))
 (setq le (vlax-get-property rp 'LocalEasting))
 (setq ln (vlax-get-property rp 'LocalNorthing))
 (setq p (list le ln))
 )

22
AutoLISP (Vanilla / Visual) / Keep a variable secret
« Last post by baitang36 on July 12, 2020, 03:40:28 AM »
If the sensitive information in the running of the program, such as the registration code, is not safe if it is stored in the global variable, can it be kept in a secret place so that the cracker can not find it and take it out at any time when he wants to use it? After many experiments, the preliminary success has been achieved. This program defines two functions (syz-set1 (x)) and (syz-get1), in which syz-set1 is to save variables and syz-get1 to take out variables.
Detailed usage:
Load syzt-new.fas And then call these two functions.
(load “syzt- new.fas ”)
(syz-set1 8888); secret preservation number 8888
(setq B (syz-get1)); take the saved 8888 and put it into the variable B, and the value of B becomes 8888
This variable can also hold strings and floating-point numbers.
This program is manually modified, variable into acad.exe Somewhere in the process, LSP cannot operate it. If the cracker wants to find it, it is quite difficult.
syzt- new.fas It is decoded. The function name in it can be changed at will, not necessarily called syz-set1. It can be changed to whatever you like.
23
AutoLISP (Vanilla / Visual) / Re: The difference between function and quote
« Last post by baitang36 on July 12, 2020, 03:20:09 AM »
baitang36, Very nice explanation. Thank you.

After studying Scheme I developed a habit of writing a lot of my code as:
Code - Auto/Visual Lisp: [Select]
  1. (defun TT (K)
  2.   ( (lambda ()
  3.      (alert K))) )
Would that function body be interpreted as a table as well?

Offset      0  1  2  3  4  5  6  7   8  9 10 11 12 13 14 15

00000000   0D 0A 20 46 41 53 34 2D  46 49 4C 45 20 3B 20 44      FAS4-FILE ; D
00000016   6F 20 6E 6F 74 20 63 68  61 6E 67 65 20 69 74 21   o not change it!
00000032   0D 0A 34 33 0D 0A 34 20  24 14 01 01 01 00 09 02     43  4 $       
00000048   00 5C 00 00 18 03 00 57  0E 00 00 00 14 00 00 00    \     W       
00000064   00 03 02 00 35 01 01 00  03 16
09 03 00 34 00 07       5        4 
00000080   19 01 00 16 24 0D 0A 31  31 37 20 34 20 24 14 01       $  117 4 $ 
00000096   01 01 00 32 00 32 18 2A  39 01 00 5B 54 54 00 00      2 2 *9  [TT 
00000112   01 01 43 00 00 03 00 0A  32 13 32 21 2A 32 00 32     C     2 2!*2 2
00000128   2B 2A 39 02 00 5B 41 4C  45 52 54 00 4B 00 00 5C   +*9  [ALERT K  \
00000144   00 00 32 13 5B 2D 6C 61  6D 62 64 61 2D 00 00 3A     2 [-lambda-  :
00000160   5C 00 00 43 00 00 04 00  0A 5C 00 00 32 00 5B 54   \  C     \  2 [T
00000176   54 00 00 3A 01 43 03 00  01 00 1C 14 01 00 00 00   T  : C         
00000192   09 02 00 0A 57 00 00 00  00 09 03 00 06 01 00 09       W           
00000208   01 00 16 15 00 16 D8 75  04 9D 0A 3B 66 61 73 34         豼   ;fas4
00000224   20 63 72 75 6E 63 68 0A  3B 24 3B 41 37 2F 31 32    crunch ;$;A7/12
00000240   2F 32 30                                                                      /20

Your program compiles like this, you can see that it has been compiled into a function, not a table
red code is lambda
24
AutoLISP (Vanilla / Visual) / Re: The difference between function and quote
« Last post by Rustabout on July 11, 2020, 11:42:07 PM »
While we are on the subject of compiling (I don't want to start a new topic), do DCL files 'embed' themselves into the compiled code? Meaning they would become part of the code and not need to be loaded from a specific location? I recall reading something along these lines but honestly can't even remember if it was even to do with LISP. That would be an extra check-mark in the 'compile' column.
25
AutoLISP (Vanilla / Visual) / Re: Sorting points by X,Y,Z coordinates...
« Last post by myloveflyer on July 11, 2020, 09:58:57 PM »
I believe this will sort x|y|z:

Code: [Select]
(defun _sort-pl ( pl )
    (   (lambda ( f ) (vl-sort pl 'f))
        (lambda ( a b / m n ) (if (= (setq m (car a)) (setq n (car b))) (f (cdr a) (cdr b)) (< m n)))
    )
)
Well done,Mp.
26
AutoLISP (Vanilla / Visual) / How to develope DynamicsCircles?
« Last post by d2010 on July 11, 2020, 04:07:30 PM »
This image , I want convert , the pop95a.mp4 to autolisp.I need only , autolisp or functional autolisp.

 :whistling:
How to develope funny-circle or mechanical-math inside Drawing?
 :smitten:: Convert pop95a.mp4 to pop95a.lsp
Original Author: Almal Khan
27
CAD General / Re: Fillet goes in a wrong direction
« Last post by Crank on July 11, 2020, 10:59:03 AM »
If there is a polyline involved, you can reverse the direction of the polyline that misbehaves. Right-click on the misbehaving polyline and select Polyline > Reverse (or type Reverse). Then fillet again.
28
CAD General / Fillet goes in a wrong direction
« Last post by HasanCAD on July 11, 2020, 09:24:40 AM »
As image
attached CAD file
29
I frequently use (findfile ...) where proceding if it doesn't exist would be bad.  Multiple calls in succession take longer, and the core function doesn't have nested folder search capability, so I have a wrapper function which does the latter as well as cache the result to be used later instead of an actual search.

I'm also moving away from using the SFSP as much, as the number of required paths has grown a bit unwieldy.
30
AutoLISP (Vanilla / Visual) / Re: Text to Closed lwolylines
« Last post by ronjonp on July 10, 2020, 01:37:45 PM »
Thank You Very Much Sir Gile. Such a relief on time and certainly a tool to learn from!

https://www.theswamp.org/index.php?topic=20642.msg251311#msg251311
There is also this which works very well: http://lee-mac.com/outlineobjects.html
Pages: 1 2 [3] 4 5 ... 10