Jump to content

Vlisp Security and Verification Questions


CADWarrior

Recommended Posts

Ok before I start I want to give you a bit of insight. I am currently working for a company that I would like to make Vlisps for to make my job quicker and easier. With that being said I would like to protect my vlisp and also make it so if they somehow managed to snatch a copy of my vlisp I could turn off the further use of it (Remote Turnoff).

 

I have read some pretty dated forum post on .FAS .VLX and .NET compiled vlisps and their security(One of the newest being in 2009). And, would love to hear what you guys think about it or if you can provide other more secure compilers.

 

As for the Remote Turnoff I was going to use a Serial Number with a date and loginname verification, but shortly thereafter I found out you could roll back the date, and didn’t think about it at the time but you could easily change the loginname. Then I got thinking what if I could verify the user was connected to the internet then load an internet source and read its code. I looked into this and tried some codes but couldn’t manage to get them to work the way I wanted.

 

Any help you guys could provide would be a great help.

 

Thank you in advance,

CadWarrior

Edited by CADWarrior
.FSA => .FAS
Link to comment
Share on other sites

  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • CADWarrior

    6

  • SOliver

    6

  • BlackBox

    4

  • alanjt

    3

Are they really so awesomely clever and sucked up that much of your life that you can't stand the idea of an unauthorized person using your LISP routine?

I love how these questions are always asked in forums where people share more code than they change their underwear.

Link to comment
Share on other sites

I know that in my contract it states that whatever I do/develop/engineer during workhours, the company owns, and I doubt that that is a uncommon practice. So to put a lock on something the company owns sounds like a really bad idea.

 

If the company sees this as something that they want, try ang negotiate a deal with them where they "buy" the routines?

 

If you really don't want anyone else to put their paws on your stuff - don't use them at work.

Link to comment
Share on other sites

I experienced a similar dilemma last year; don't get me wrong I'm all for open source but my employer were selling it on and wanted to ensure that both only the client could use it and that it could only be used on one computer. I know right? The script itself was only around twenty lines; the validation script was at least twice that.

 

Anyway here's a summary of how I went about it.

 

Prerequisites:

web server

Sql database

 

When the user ran the script the registry was checked to see if the user the computer had a lisence, if it didn't

 

1. the user was prompted to enter a company name and passphrase.

2. an http request was sent to the server which used the passed credentials to check if the client had an available lisence for the script.

3. Upon successful identification of a lisence a registry key was created based on the Acad lisence key

4. Finally the script checked the key and made sure it was valid (not some random or a duplicate from another machine)

 

The bittersweet irony of it all was that regardless of how it was written I couldn't make it so that if someone had pirated autocad they would be able to use it on multiple computers with a bit of registry play.

 

Hope that gives you some ideas.

SOliver.

Link to comment
Share on other sites

Normally I wouldn’t care if they used it. But, this vlisp cuts my work from 10 hours down to about 15 min. And it makes the work so easy that they would have no use for me after that. I worked on this on my own time and effort so the company has no right to it.

Are they really so awesomely clever and sucked up that much of your life that you can't stand the idea of an unauthorized person using your LISP routine?

I love how these questions are always asked in forums where people share more code than they change their underwear.

 

 

This was a little uncalled for. I was just wondering on peoples thoughts and ideas.

Link to comment
Share on other sites

Normally I wouldn’t care if they used it. But, this vlisp cuts my work from 10 hours down to about 15 min. And it makes the work so easy that they would have no use for me after that. I worked on this on my own time and effort so the company has no right to it.

 

 

This was a little uncalled for. I was just wondering on peoples thoughts and ideas.

And I was answering with my thoughts. I meant no offense. I was just stating how I felt.
Link to comment
Share on other sites

Just a thought, as it is your own work done on your own time, why not just put all your routines on a USB drive and call them up from that?

That way, if you and the company split, they have not got your routines on the system to use ad finitum.

Otherwise Tiger's advice is spot on..

 

Snip> If the company sees this as something that they want, try and negotiate a deal with them where they "buy" the routines?

 

If you really don't want anyone else to put their paws on your stuff - don't use them at work.

 

Rob.

Link to comment
Share on other sites

My two cents....

 

The only 'valid' (ethical?) purpose I see for incorporating 'security' of any kind for internal distribution, is to prevent undesired (damaging?) changes to others' production environment, drawings, etc.... otherwise, let it (the code) 'flow'.

 

Normally I wouldn’t care if they used it. But, this vlisp cuts my work from 10 hours down to about 15 min. And it makes the work so easy that they would have no use for me after that. I worked on this on my own time and effort so the company has no right to it.

 

10 hours reduced to only 15 minutes!? :glare:

 

What Senior Designer issued out that work assignment!? God help you, and your employer if the client ever finds out!!! :lol: lmao

 

Seriously... If your code were really *that* 'awesomely clever' dude, your boss, and your boss' boss would be ecstatic at the production savings they could potentially pass on to clients. Besides, if they (management) decided to reduce overhead costs (read let someone go), it wouldn't be you - the productivity genius - to think otherwise is simply laughable IMHO.

 

Furthermore, if you're that highly skilled with Visual LISP, then why not apply to Autodesk, or submit to teach an Autodesk University course or something...? This is not meant to be a challenge, but simply a suggestion that you may find to be personally rewarding, and perhaps lucrative.

Link to comment
Share on other sites

Seriously... If your code were really *that* 'awesomely clever' dude, your boss, and your boss' boss would be ecstatic at the production savings they could potentially pass on to clients. Besides, if they (management) decided to reduce overhead costs (read let someone go), it wouldn't be you - the productivity genius - to think otherwise is simply laughable IMHO.

 

I sort of agree with this comment. If the code cuts the time it takes to carry out the work then your boss will be over the moon and it can only lead to good things for yourself.

 

What I don't agree with is that the code is exceedingly clever. A basic script handling a labourious task can cut long hours down to practically no time at all.

Link to comment
Share on other sites

What I don't agree with is that the code is exceedingly clever. A basic script handling a labourious task can cut long hours down to practically no time at all.

Quite true. My most used LISPs are some my simplest ones. A LISP macro that can turn 5 steps into one that is used multiple times, throughout the day can be much more 'valuable' than one that saves a hour but is only utilized once a week.

Link to comment
Share on other sites

I sort of agree with this comment.

 

Cheers!

 

What I don't agree with is that the code is exceedingly clever. A basic script handling a labourious task can cut long hours down to practically no time at all.
Quite true.

 

That may be impossible to know for sure... *unless* the OP is willing to post the code!? :lol: lmao

 

My most used LISPs are some my simplest ones. A LISP macro that can turn 5 steps into one that is used multiple times, throughout the day can be much more 'valuable' than one that saves a hour but is only utilized once a week.

 

Agreed.

Link to comment
Share on other sites

That may be impossible to know for sure... *unless* the OP is willing to post the code!? :lol: lmao

 

Hehe well played.

 

EDIT:

 

What do you think op? Join the open source side (the morally righteous dark side).

Edited by SOliver
Link to comment
Share on other sites

Think I have the solution.

 

Create, if you don't have already, an online email account. Save super hardcore||basic labour neutralisers as drafts. (Probably make a sub directory for them).

Link to comment
Share on other sites

Cuts the job down from 10 hours to 15 minutes? If it is something you have to do regularly you would want to be careful that the employer doesn't decide to cut your job hours down a week.

Link to comment
Share on other sites

Cuts the job down from 10 hours to 15 minutes? If it is something you have to do regularly you would want to be careful that the employer doesn't decide to cut your job hours down a week.

 

The thing with this is that employment is an action film. Assuming the OP is not a contractor then his employer would be open to legal repercussion and probably bad media coverage, locally at least. OP can keep quiet about the script in which case his employer will either think the quality of work must be flawed or that he loiters more than he works. Alternatively he could bring the script up and at the very leasst earn a positive reputation with management [ sic] as long as he compiles with @author:OP printing on load so his boss doesn't lay claim to magic.

Link to comment
Share on other sites

Wow wasn’t expecting this to turn into an ethical discussion while I was gone the last few days.

But anyhow I would post the code but it would be useless to most if not all people. So instead I will post some of the notes I jotted down on a .txt file the rest are all in my head or on paper and too lazy to type them out

Basic over of Lisp:

 

 

 
[list]
[*][font=Tahoma]User opens Floor Plan of building and uses start up lisp[/font]
[*][font=Tahoma]Checks to see if user is authorized to use Lisp and is connected to the internet.[/font]
[*][font=Tahoma]After connect and authorization is established. Lisp will self update all updated lisps through the SQL server.[/font]
[*][font=Tahoma]User selects walls/roof/floor on the floor plan layouts- Can erase create and back out to change selection for each step[/font]
[*][font=Tahoma]Automatically updates independent origin for calculation package.[/font]
[*][font=Tahoma]Finds all cord points for wall center lines and roof and floor projection cord points[/font]
[*][font=Tahoma]Closes all drawings but currently open drawing and opens all .dwg files in files current location[/font]
[*][font=Tahoma]Goes through each drawing and finds the Named items from step 4. [/font]
[*][font=Tahoma]After an item is found it will request additional information based on if it was a Floor Wall Roof the closes the page and removes it from the Open list, but saves it to a finished list if you would like to go back and edit it.[/font]
[*][font=Tahoma]Inserts all information into a calculation package and releases a final product without user ever having to exit Autocad.[/font]
[/list]

 

Update log:

 

[font=Tahoma]1.x Floor Plan Extract[/font]
[font=Tahoma]-.0 Original[/font]
[font=Tahoma]2.x Wall/Floor/Roof Extract[/font]
[font=Tahoma]-.0 Original[/font]
[font=Tahoma]-.1 Extract name from current drawing[/font]
[font=Tahoma].1 find Average Height of wall, length, and Thickness[/font]
[font=Tahoma].2 WALLS[/font]
[font=Tahoma]Extract Anchor Locations If it doesnt match an of the dist valves of original or inverse discard (set inversed if distances match inversed)[/font]
[font=Tahoma]Count number of Anchors based on X[/font]
[font=Tahoma]Find base anchor locations[/font]
[font=Tahoma].3 FLOORS/ROOFS[/font]
[font=Tahoma]Gather information[/font]
[font=Tahoma]3.x Calc I/O[/font]
[font=Tahoma]-.0 Original[/font]
[font=Tahoma]4.x User Options[/font]
[font=Tahoma]-.0 Original[/font]
[font=Tahoma].1 Use vl-bb-set and vl-bb-ref to extract in 1.x to 3.x[/font]
[font=Tahoma]5.x Embed Drawings[/font]
[font=Tahoma]-.0 Original[/font]
[font=Tahoma].01 Find all drawing name store to vl-bb-set array (Sorted by Alpha and Numerical)[/font]
[font=Tahoma].02 Close all drawings other than the one that is currently open[/font]
[font=Tahoma].03 Open all drawings inside current drawing file[/font]
[font=Tahoma].04 Find all anchor blocks in all drawings using a cond statement[/font]
[font=Tahoma].05 Move to original drawing and open all previously opened drawings[/font]
[font=Tahoma].06 Open new drawing with a given block[/font]
[font=Tahoma].07 Insert blocks of anchors[/font]
[font=Tahoma].08 Erase Block from Array and save back[/font]
[font=Tahoma].09 Save when full[/font]
[font=Tahoma]      Name Embeds-x[/font]
[font=Tahoma].10 Create new after[/font]
[font=Tahoma].11 Repeat .09 and .10 as needed[/font]

 

At this time each calculation has about 12k input everything from Seismic and wind shear and tension to Relative anchor positions vs. distance from applied pressure.

Edit:

I am a part time contractor but for my employer currently I am more of in-house contractor. I am paid for the time it should take the average person. IE this calc pack would usually take someone 15+ hours that’s not including drawings and so on. But if I can do it in say 10 hours I am paid for the 15 and that’s what we charge out. Kind of hard to explain but it works out.

I have tried to apply my experience to everything I do but I get stomped on every time I try. Hell I recommended 1 thing that would have saved the company 50k+ easily in the first year but instead they shot me down and 3 months later they get audited for the very thing I was trying to stop. Sense then I dont really apply myself other then what my job intails.

And as a further example of how this company works I had to write a proposal just to get a 2nd monitor out of the stock pile they have....

But anyhow back on subject. Anyone have any input on the .FAS vs .VLX vs .NET?

Edited by CADWarrior
See "Edit:"
Link to comment
Share on other sites

But anyhow back on subject. Anyone have any input on the .FAS vs .VLX vs .NET?

 

I personally write LISP code (AUTO / Visual), and compile all projects to either .FAS / .VLX files.

 

Now that we're switching from Land Desktop to Civil 3D, I got a copy of Visual Studio, and the appropriate Autodesk SDK's, but have not yet developed a single production-ready tool using .NET... As I'm comfortable writing Visual LISP (ActiveX COM), I'm pursuing VB.NET specifically.

 

Additionally, Windows Presentation Foundation (WPF) also is very appealing... I'm considering how I might embed our directional bore calculation web page within a tool palette. We'll see what happens.

Link to comment
Share on other sites

If your a contractor then good luck to you if you have the most up to dates tools, (lisps) the latest klingon battery powered saws and drills, the company does not buy your tools off you, they are part of your payment rate. They employ some one else and get a reality check.

 

Like you I did a wall scheduling routine for precast panels based on the floor plan but we were paid to do it, and yes "If your code were really *that* 'awesomely clever' dude " yes its possible 20 mins v's 20 secs now. But how many hours went into writing the code ?

 

A commercial product I know of once bragged if after a week you have not saved 1/2 your purchase cost will give your money back.

Link to comment
Share on other sites

If your a contractor then good luck to you if you have the most up to dates tools, (lisps) ... They employ some one else and get a reality check.

 

Agreed.

 

... and yes "If your code were really *that* 'awesomely clever' dude " yes its possible 20 mins v's 20 secs now. But how many hours went into writing the code ?

 

Yes... "20 mins v's 20 secs" is a reasonable (common?) increase in productivity for good LISP utilities... I've never once heard of reducing 15 hours of production work down to 15 minutes (until now).

 

Incorrectly or not, yeah, I felt that estimation was a *bit* of an exaggeration.

 

The fact that the OP (a contractor) is/was smart enough to 'develop' this dynamic with his employer (pun intended), speaks to the cleverness of the OP.

Link to comment
Share on other sites

Nahh not really and exaggeration. I could have sworn i said 10 hours :P but anyhow before I started working there the engineers use to take 18 hours+ to do calculations. They still take that long because I refuse to give them my stuff. (bunch of arrogant.... ahhhmm sorry) If you take the calculation lightly it will take about 10 hours to do and that's after I automated most of the stuff. If I was to absolutely bust ... it would take about 7 hours minimum and that utilizing 2 screen and being able to type with one hand so my hand never leaves the mouse. With this lisp I now never have to leave Cad cutting my time alone in that by half (switching between UI's to gather information). The automation of all points (including base anchor wall connect points roof connection points) decreases my time even further and it just keep cutting off time on input and information gathering.

 

And rest assured I will be posting all my utility scripts in here for you guys but cant give them all to you :P (i know you contractors out there looking to steal my business :twisted:)

 

Here are some ones that I have 100% finished for this project as of now.

 

Internet Verification part 1

(defun Linked (/)
;|                                  
   Error Checks                    
   Code=>Info                      
   1=> Connection Established      
   2=> Not Connected to Internet   
   3=> Could not find URL          
   4=> The URL is not valid        
                                 |;
 (setq link "www.google.com")
 (setq util (vla-get-Utility (vla-get-ActiveDocument (vlax-get-acad-object))))
 (if (eq (vla-isurl util link) :vlax-true)
   (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-GetRemoteFile (list util link 'tmp :vlax-true)))
     (setq ok (list 4 "\nCould not find URL."))
     (progn
   (if (zerop (vl-file-size tmp))
     (progn
       (vl-file-delete tmp)
       (setq ok  (list 2 "\nYou are not connected to the Internet or Your firewall is blocking this process."))
       )
     (progn
       (vl-file-delete tmp)
       (setq ok  (list 1 "\nConnection Established"))
       )
     )
   )
     )
   (setq ok  (list 3 "\nThe url is not valid."))
   )
 ok
 )

I was never fond of the way WSmatch worked so I made my own

 

;|
Example
(keyword  7 (list "F you man" "Your mom" "Your sister" "Sorry you're like looking  at a train wreck I just can't look away") "What are you looking at?")
|;
(defun keyword (inittype lst Question /)
 (setq opt "")
 (foreach item lst
   (if (= opt "")
     (setq opt item)
     (setq opt (strcat opt "/" item))
     )
   )
 (setq kwext nil)
 (while (= kwext nil)
   (if (/= question "")
     (progn
   (initget inittype)
   (setq selection (getstring (strcat "\n" Question "<" opt ">:")))
   )
     (progn
   (initget inittype)
   (setq selection (getstring (strcat "\nPlease input option<" opt ">:")))
   )
     )
   (setq strcon (strlen selection))
   (setq count 1)
   (setq wmat nil)
   (while (< count (+ strcon 1))
     (setq letter (substr selection count 1))
     (if (= wmat nil)
   (setq wmat (strcat "*" letter "*"))
   (setq wmat (strcat wmat letter "*"))
   )
     (setq count (+ count 1))
     )
   (setq matches 0)
   (foreach item lst
     (if (wcmatch (strcase item) (strcase wmat))
   (progn
   (setq matches (+ matches 1))
   (setq foundmatch item)
   )
   )
     )
   (cond
     ((= matches 0)(princ "\nNo matches found. Please try again."))
     ((= matches 1)(setq kwext 1))
     ((> matches 1)(princ "\nToo many matches. Please try again."))
     (t (princ "\nHow the hell did you get here?"))
     )
   )
 foundmatch
 )

Here was the reason I created Keyword because getkword and initget were not strict enough

(defun c:test (/)
 (setq ext nil)
 (while (not ext)
    (setq fint (keyword 7 (list "A" "C" "D" "F" "G" "H" "I" "K" "L" "M" "N"  "O" "P" "R" "S" "T" "U" "V" "W") "\nFirst letter of state "))
   (cond ((= fint "A")(progn
            (setq sname (keyword 7 (list "ALabama" "AlasKa" "AriZona" "ARkansas" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "C")(progn
            (setq sname (keyword 7 (list "California" "Colorado" "Connecticut" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "D")(progn
            (setq sname (keyword 7 (list "Delaware" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "F")(progn
            (setq sname (keyword 7 (list "Florida" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "G")(progn
            (setq sname (keyword 7 (list "Georgia" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "H")(progn
            (setq sname (keyword 7 (list "Hawaii" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "I")(progn
            (setq sname (keyword 7 (list "Idaho" "Illinois" "Indiana" "Iowa" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "K")(progn
            (setq sname (keyword 7 (list "Kansas" "Kentucky" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "L")(progn
            (setq sname (keyword 7 (list "Louisiana" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "M")(progn
             (setq sname (keyword 7 (list "Maine" "Maryland"  "Massachusetts" "Michigan" "Minnesota" "Mississippi" "Missouri"  "Montana" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "N")(progn
             (setq sname (keyword 7 (list "Nebraska" "Nevada" "New  Hampshire" "New Jersey" "New Mexico" "New York" "North Carolina" "North  Dakota" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "O")(progn
            (setq sname (keyword 7 (list "Ohio" "Oklahoma" "Oregon" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "P")(progn
            (setq sname (keyword 7 (list "Pennsylvania" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "R")(progn
            (setq sname (keyword 7 (list "Rhode Island" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "S")(progn
            (setq sname (keyword 7 (list "South Carolina" "South Dakota" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "T")(progn
            (setq sname (keyword 7 (list "Tennessee" "Texas" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "U")(progn
            (setq sname (keyword 7 (list "Utah" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "V")(progn
            (setq sname (keyword 7 (list "Vermont" "Virgin Islands" "Virginia" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     ((= fint "W")(progn
            (setq sname (keyword 7 (list "Washington" "West Virginia" "Wisconsin" "Wyoming" "Back") "\nState Name "))
            (if (/= (strcase sname) (strcase "Back"))
             (setq ext 1)
              )))
     )
   )
 )

I couldnt find a round function for autocad and as I found out autocad isnt 100% accurate.

 

(setq a 2.222222)
(setq b 2.222222)
(if (= a b) t nil)
nil

turned out to be more like

 

(setq a 2.22222222221)
(setq b 2.22222222222)
(if (= a b) t nil)
nil

It was throwing off calculations that needed to be 100% accurate so i had to use a round function

 

So I created this

(defun round (number xth / ro x y out)
 (if (> xth 0)
   (progn
     (setq ro (rem number 1)) 
     (setq x (- number ro)) (if (>= (rem (* (expt 10 xth) ro) 1) 0.5) (setq add 1) (setq add 0))
     (setq y (/(- (* (expt 10 xth) ro) (- (rem (* (expt 10 xth) ro) 1) add)) (expt 10 xth)))
     (setq out (+ x y))
     )
   )
 (if (= xth 0)
   (progn
     (setq ro (rem number 1))
     (setq out (- number ro))
     )
   )
 (if (< xth 0)
   (progn
     (setq xth (* xth -1))
     (setq ro (rem (/ number (expt 10 xth)) 1))
     (setq out (* (- (/ number (expt 10 xth)) ro)(expt 10 xth)))
     )
   )
 out
 )

Next I had a concern about users not supplying a correct Origin Point for the build to reference from so I created this

 

(defun setorg ( / )
 (setq org (list 0 0 0))
 (setq flistrevised nil)
 (setq rlistrevised nil)
 (setq wlistrevised nil)
 (setq xmin nil)
 (setq ymin nil)
 (foreach item flist
   (setq x1 (nth 1 item))
   (setq y1 (nth 2 item))
   (setq x2 (nth 3 item))
   (setq y2 (nth 4 item))
   (if (= xmin nil)
     (setq xmin (min x1 x2))
     (if (< (min x1 x2) xmin)
   (setq xmin (min x1 x2))
   )
     )
   (if (= ymin nil)
     (setq ymin (min y1 y2))
     (if (< (min y1 y2) ymin)
   (setq ymin (min y1 y2))
   )
     )
   )
 (foreach item rlist
   (setq x1 (nth 1 item))
   (setq y1 (nth 2 item))
   (setq x2 (nth 3 item))
   (setq y2 (nth 4 item))
   (if (= xmin nil)
     (setq xmin (min x1 x2))
     (if (< (min x1 x2) xmin)
   (setq xmin (min x1 x2))
   )
     )
   (if (= ymin nil)
     (setq ymin (min y1 y2))
     (if (< (min y1 y2) ymin)
   (setq ymin (min y1 y2))
   )
     )
   )
 (foreach item wlist
   (setq x1 (nth 1 item))
   (setq y1 (nth 2 item))
   (setq x2 (nth 3 item))
   (setq y2 (nth 4 item))
   (if (= xmin nil)
     (setq xmin (min x1 x2))
     (if (< (min x1 x2) xmin)
   (setq xmin (min x1 x2))
   )
     )
   (if (= ymin nil)
     (setq ymin (min y1 y2))
     (if (< (min y1 y2) ymin)
   (setq ymin (min y1 y2))
   )
     )
   )
 (if (= xmin nil) (setq xmin 0))
 (if (= ymin nil) (setq ymin 0))
 (if (or (/= xmin 0) (/= ymin 0))
   (progn
     (setq org (list xmin (* -1 ymin) 0))
     (command "ucs" org "")
     (setq xdif (nth 0 org))
     (setq ydif (* -1 (nth 1 org)))
     (setq zdif (nth 2 org))
     (foreach item flist
   (setq name (nth 0 item))
   (setq x1 (nth 1 item))
   (setq y1 (nth 2 item))
   (setq x2 (nth 3 item))
   (setq y2 (nth 4 item))
   (setq stype (nth 5 item))
   (setq xa1 (min (round (- x1 xdif) 3)(round (- x2 xdif) 3)))
   (setq ya1 (min (round (- y1 ydif) 3)(round (- y2 ydif) 3)))
   (setq xa2 (max (round (- x1 xdif) 3)(round (- x2 xdif) 3)))
   (setq ya2 (max (round (- y1 ydif) 3)(round (- y2 ydif) 3)))
   (setq flistrevised (append flistrevised (list (list name xa1 ya1 xa2 ya2 stype))))
   )
     (foreach item rlist
   (setq name (nth 0 item))
   (setq x1 (nth 1 item))
   (setq y1 (nth 2 item))
   (setq x2 (nth 3 item))
   (setq y2 (nth 4 item))
   (setq stype (nth 5 item))
   (setq xa1 (min (round (- x1 xdif) 3)(round (- x2 xdif) 3)))
   (setq ya1 (min (round (- y1 ydif) 3)(round (- y2 ydif) 3)))
   (setq xa2 (max (round (- x1 xdif) 3)(round (- x2 xdif) 3)))
   (setq ya2 (max (round (- y1 ydif) 3)(round (- y2 ydif) 3)))
   (setq rlistrevised (append rlistrevised (list (list name xa1 ya1 xa2 ya2 stype))))
   )
     (foreach item wlist
   (setq name (nth 0 item))
   (setq x1 (nth 1 item))
   (setq y1 (nth 2 item))
   (setq x2 (nth 3 item))
   (setq y2 (nth 4 item))
   (setq dir (nth 8 item))
   (setq thk (nth 5 item))
   (setq xa1 (min (round (- x1 xdif) 3)(round (- x2 xdif) 3)))
   (setq ya1 (min (round (- y1 ydif) 3)(round (- y2 ydif) 3)))
   (setq xa2 (max (round (- x1 xdif) 3)(round (- x2 xdif) 3)))
   (setq ya2 (max (round (- y1 ydif) 3)(round (- y2 ydif) 3)))
   (if (= dir "X")
     (progn
       (setq Xpri (min xa1 xa2))
       (setq Ypri (+ (min ya1 ya2) (/ (- (max ya1 ya2) (min ya1 ya2)) 2)))
       )
     (progn
       (setq Ypri (min ya1 ya2))
       (setq Xpri (+ (min xa1 xa2) (/ (- (max xa1 xa2) (min xa1 xa2)) 2)))
       )
     )
   (setq wlistrevised (append wlistrevised (list (list name xa1 ya1 xa2 ya2 thk Xpri Ypri Dir))))
   )
     (if flistrevised
   (setq flist flistrevised)
   )
     (if rlistrevised
   (setq rlist rlistrevised)
   )
     (if wlistrevised
   (setq wlist wlistrevised)
   )
     (wallintersection)
     (wallsordered)
     )
   )
 )

When I finish up some more stuff I will post it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...