Jump to content

Draw 2 rectangles one half the size of the other in diesel.


Glen1980

Recommended Posts

^C^C_rectang;\\scale;l;;m2p;$M=$(getvar,lastpoint);\c;0.5;

 

For setting out of lights I need to draw a rectangle then scale it by half so I can position the lights in the corner of the rectangle. I'm gathering with LT and Diesel I can't get the blocks to automagically appear on the rectangle?

I've had a go with the macro above to generate my rectangles with a minimum of clicks, it works fine but I was wondering if there was any improvements to be made, i.e. is there a way of getting LT to remember my first click for the first rectangle and replicating it for the mid 2 point section?

Link to comment
Share on other sites

You need to look at controlling the evaluation sequence of the diesel strings, you're example doesn't look impossible but, it does need you to look into the timing of diesel elements, first thing you really should do is make the variable "macrotrace=1", that will show you what is happening when you run a diesel macro. I'd better say here that I haven't got a working version up and running just some pointers. Take a look at these documents http://www.crlf.de/Dokumente/Diesel/Diesel1.html

http://members.iinet.net.au/~bigbyte/diesel.htm

To see if you can find some help. It's not straightforward, I am working on a similar thing at the moment, if you get a working solution let me know, and I'll post back when I get something as well (the word is when - not if) :lol:

Link to comment
Share on other sites

BIGAL

 

 

I need to place the centre of the smaller rectangle in the middle of existing one, I have to have to put the first light a quarter of the rooms length/width in from the wall, have half the rooms length width between the 2 rows of lights, this was the easiest way I could think of setting it out, and as there are so many rooms I wanted to simplify it with a macro. In 2016 I think I will have a new osnap for centre of geometry but my 2012 using colleagues won't.

Link to comment
Share on other sites

Or maybe something like

^C^C^Cid;\setenv;pt1;$M=$(index,0,$(getvar,lastpoint)),$(index,1,$(getvar,lastpoint));"id;\setenv;pt2;$M=$(index,0,$(getvar,lastpoint)),$(index,1,$(getvar,lastpoint))";rec;"""$M=$(getenv,pt1);$(getenv,pt2)""";sc;l;;mtp;"""$M=$(getenv,pt1);$(getenv,pt2)""";c;0.5;

I have to be honest it was a lot of guesswork, just shifting quotes around until it suddenly worked. Now if I can just get "cal" to work nicely in there, I'll have my problem sorted as well.

Link to comment
Share on other sites

Thanks Steven I was trying to remember the setenv bit for storing pts. Sometimes I think its easier to cut and paste ID to a excel then just copy the correct column back with it all worked out.

Link to comment
Share on other sites

Bigal, I believe that setenv is the one thing that we LT users have that is actually not available in full Autocad, I use it quite a bit for all sorts of macro's, and indeed using excel is often the easiest method if you are comfortable using it, but it does mean manually switching program environments, which isn't always convienient.

Link to comment
Share on other sites

. . . . setenv is the one thing that we LT users have that is actually not available in full AutoCAD . . . .

 

That's an odd decision on Autodesk's part. Not that LT users shouldn't have a feature to make their work lives more efficient, more like allowing another potential obstacle to a full AutoCAD upgrade.

Link to comment
Share on other sites

That's an odd decision on Autodesk's part. Not that LT users shouldn't have a feature to make their work lives more efficient, more like allowing another potential obstacle to a full AutoCAD upgrade.

The only obstacle we have to upgrading to full AutoCad is big, fat, bald and smokes cigars, and they call him Bruce. :lol:

Link to comment
Share on other sites

The only obstacle we have to upgrading to full AutoCad is big, fat, bald and smokes cigars, and they call him Bruce. :lol:

 

I hear you. The lack of a feature would not be the biggest obstacle.

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...