AutoHotkey Community

It is currently May 27th, 2012, 7:45 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: A facelift for Vellum3D
PostPosted: September 27th, 2006, 4:13 am 
Offline

Joined: September 19th, 2006, 2:09 pm
Posts: 28
Vellum3D is my trusted 2D Cad app. Over the last year I thought I should upgrade to a more modern drafting application, as it's around for over ten years. I design everything straight in 3d with Sketchup, a simple but truly ingenious thing. In Vellum I draft construction plans, but I missed the wonderful data management of Sketchup.

I tried ArchiCAD and VectorWorks for a while but they're just not as smooth as I wish. If I could implement some of the features of the newer applications into Vellum3D I could design the best thinkable application. Thanks to AHK many improvements were made in the last weeks. Halleluja for AHK!

One of the thingies I made is a PickAndDraw macro. Instead of wandering all over the place to change settings and choose a command, this script allows to just pick an item, then change settings according to this item, apply them to other objects, or draw new clone objects. I've wanted this tool for ages and now it works, I'm SoHappy.

The first version is posted here:
http://www.autohotkey.net/~Berke/PickAndDraw/PickAndDraw.ahk

Bear with me, three weeks ago I hadn't even heard of AHK and I've got no programming experience. It works, but I guess it could be better structured. I had some trouble with understanding functions (or labels?) so it's all a bit linear and straightforward. I would definitely appreciate advice on improvements if anyone cares to take a look at it.

If there are still any Vellum or Graphite users around, give a yell and I'll adapt it so it doesn't rely on any internal macro's anymore.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 27th, 2006, 9:38 am 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
OK, I will take a quick look... Remarks below as I read it, obviously not tested...

- Line 27, the test will apply only on the first line below it... You should enclose several lines between braces. But these lines (that could use a loop) are not necessary, as the content of the variables will be overwritten anyway by the ControlGetText lines.

- Line 49 and below: here again, you could have used loops, but that's not a major problem.
Code:
Loop 6
   ControlGetText, CboxA%A_Index%, ComboBox%A_Index%, Edit Objects

- Line 85 and below: you can remove the Returns and put one at the end of the main If.

- Line 219: use a continuation section, it removes the need for lot of `n and is easier to read (and to post in forum! ;-)).

- Line 232: a Return is probably missing after this line. Take the one at 243, two successive Returns are redundant.

- Later, I see you rely heavily on MouseClicks. I suppose this interface doesn't have reliable keyboard shortcuts? Well, as long as it works for you...

- Line 624: (DRAW:) I see several Ifs and an Else at same level.
For better efficiency (less tests to perform), and to effectively display the MsgBox only if type isn't one of the above, you have to put an Else before each If (except the first one, of course):
Code:
If type = Wall
   Send +^w
Else If type = Line
   ...
Else
   MsgBox ...

Seems I have reached the bottom...
I hope these advices can help you.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 27th, 2006, 3:05 pm 
Offline

Joined: September 19th, 2006, 2:09 pm
Posts: 28
PhiLho,

thanks for your time. Your advice about using Else If proves very useful.

Indeed I had to rely on mouseclicks to scroll the boxes. I have tried everything I could, including insecure attempts with SendMessage with snippets I found around on the forum, but nothing worked except sending clicks to the scroll buttons. I wrote one that worked but then discovered Rajat's scroll script that's better written.

In fact scrolling the drawing window was one of the main questions to tackle. On this forum I was pointed to KatMouse, which worked for vertical scroll, then since I knew it was possible I went on and found MouseImp, which works fantastic. I wish there was a way to find out how these two can get to my Vellum3D window.

As you could see in the script I am sending the mouse to a control box and doubleclick at certain coordinates to choose a color or layer. It's slow, unelegant, and if a new layer comes in it all blows up.....

eeeh, well as I'm writing this, I found the solution anyway:
Code:
color = Blue
Control, ChooseString, %color%, Listbox1, Pen Colors
ControlClick, Button1, Pen Colors


HURRAY!!!

My other Main Challenge is to retrieve the header of the Edit Objects box:

Image

It's not visible on AHK Window Info. If I could get to this text I wouldn't have to go through sorting the objects by the character of their properties in my code. For the PickAndDraw command, I could just get the properties of the object, set them general with Control, choosestring, and issue a drawing command according to this header. It would be a lot faster. It does work now, but maybe I'm overlooking something obvious?

The last Draw subroutine keeps running afterwards, this was serendipitous but I'd like to know how I can give an instruction to finish it.

Rajat used:
Code:
SetDefaultMouseSpeed, 0 ;fastest setting
SetMouseDelay, -1 ;no delay at all,


Would this speed up all the mouseclicking?

I included a few sleep commands, not sure if they're any use?

thank you for your patience.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 28th, 2006, 2:24 pm 
Offline

Joined: May 19th, 2006, 4:56 am
Posts: 166
Is there another name for this software than Vellum 3D? I googled it, but couldnt find something with this name.

I use SolidWorks, but im always curious about other 3D packages.

This thread comes up as the second link in google :P

http://www.google.com/search?lr=&ie=UTF ... q=Vellum3D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 28th, 2006, 2:59 pm 
Offline

Joined: December 27th, 2005, 1:46 pm
Posts: 6837
Location: France (near Paris)
You googled for Vellum3D. Searching "Vellum 3D" gives me more than 700 hits... Anyway, it is seems to be old, by Berke's description, so it might be no longer available.

_________________
Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 30th, 2006, 12:22 pm 
Offline

Joined: September 19th, 2006, 2:09 pm
Posts: 28
Vellum 3D was revolutionary at the time the lesser gods were still being plagued by Autocad 14, being built around a very good tracker function, later licensed by all the big ones like AutoCad. The contemporary version is called Graphite but remains nearly unchanged. For drafting it is only surpassed by Vectorworks (better data management), although basic functionality is still a tiny bit better in Vellum (construction lines notably). But it would be easier to implement the strong points of Vellum into Vectorworks than the other way around, as I'm trying to do now with AHK. But well it's a challenge, and you kind of grow accustomed to your drafting program after ten years.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Cristi®, nothing and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group