Insert Line

I am building a library of standard blocks to insert in my drawings. At the end I extract the atributes and create a parts list of all elements
(blocks) in the drawing. The different blocks are connected with lines. One of the elements I am strugling with is this simple line. I want to attach a block name to line unit line (1 unit) and when I insert it I should be able to snap to start point and snap to an end point under any angle. When I extract the attibutes I would than like to get the length of each line instead in the drawing. Any body who can help me on my way. I have been reading up on dynamic blocks and I have been doing some excercises with desks and chairs and phones etc. Althoug useful, this is not exactly what I am looking for. Maybe I can do something similar with a line but I could not get this to work exactly as I need. Thanks for your time.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Assuming it HAS to be a block, and I'm not sure it does, can't you scale a "line" block between the required points, and then write a routine to insert the line block and enter the scale of the block and into the block's attribute? That one sounds really easy...
--


MichaelB
www.michaelbulatovich.ca
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
The line needs to carry a part number like R99903120 (or given this number as an attribute while inserting it) and at the end of the ride when I extract the attributes it need to see how many lines with part number R99903120 there are and the length of each line. Can you help me a bit further with this routine and how to enter (by snapping to begin and end point) the length into the blocks attributes? Thanks for your time.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
If the line block has a base length of one unit, your routine can ask for a From Point and a To Point. The distance between them is your scale factor, and the value for your length attribute. The angle between them is your rotation for the block insertion. The first point could be your inset. With all that your block insertion is done. All that's left is the attribute entry, and there are a couple of ways to do that.
--


MichaelB
www.michaelbulatovich.ca
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Thanks Michael, I think I can handle insert from...to. Next question is how do I get/read/collect the scale factor?.. in some kind of variable that I than use to write the atribute data? ...... ...... By the way, I've spend some time exploring your website... Most impressive. I feel humbled.
Thanks, Daniel
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
I suggest that you input it as part of your line insertion routine. Through prompts, you request the information, and then feed it to other parts of the routine as required. First one might be the line block insertion. Second one might be the attribute assignment. After the attribute is assigned the value you, presumably, will use your current method for extracting it. You don't have to have the length as an attribute value, of course. It would be simpler to just extract the scale of the block form the entity data, but you would need to create a way of linking the length to the part number. That can't be too hard, but if you already have something that extracts attributes beautifully, jumping through the extra hoops for the lines might be worth it. It's your application.
Thanks about the site. I just took down the picture of me on the front page (messy hair, holding two glasses of chardonnay in the countryside). People keep telling me I should play it safer, and as I get older I find myself starting to listen to them....sometimes....

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
HiHo; "xdat" will work also.

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.