Author Topic: Jigging a block with Alignment parameter  (Read 6734 times)

0 Members and 1 Guest are viewing this topic.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Jigging a block with Alignment parameter
« Reply #15 on: November 21, 2012, 04:23:26 PM »
Yes but too much automation wanted to use built in 'Insert' command.

TheMaster

  • Guest
Re: Jigging a block with Alignment parameter
« Reply #16 on: November 21, 2012, 06:52:44 PM »
Yes but too much automation wanted to use built in 'Insert' command.

Ummmm.  Not sure I understand that. 

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Jigging a block with Alignment parameter
« Reply #17 on: November 21, 2012, 07:27:51 PM »
Yes but too much automation wanted to use built in 'Insert' command.

Ummmm.  Not sure I understand that.
I am about to run out the door to take kid to movie, but I take that comment as red flag, which leads me to think I am approaching the problem incorrectly and will give a better explanation later today or tommorrow, and if you have the time hopefully I could get your or anyone else input on a basic overview how they might approach it.

TheMaster

  • Guest
Re: Jigging a block with Alignment parameter
« Reply #18 on: November 21, 2012, 08:59:08 PM »
Yes but too much automation wanted to use built in 'Insert' command.

Ummmm.  Not sure I understand that.
I am about to run out the door to take kid to movie, but I take that comment as red flag, which leads me to think I am approaching the problem incorrectly and will give a better explanation later today or tommorrow, and if you have the time hopefully I could get your or anyone else input on a basic overview how they might approach it.

Not a red flag, but I don't know what 'too much automation wanted' means exactly.

I can give you my input now, which is that it really doesn't pay to jump through as many hoops as would be necessary to support dynaic block alignment parameters in a jig, if the end result can be reached by scripting the INSERT command with little or no perceptible difference. If the underlying objective is to do it solely for the sake of the challenge, that's fine as long as whomever is paying for it also understands that.


Jeff H

  • Needs a day job
  • Posts: 6150
Re: Jigging a block with Alignment parameter
« Reply #19 on: November 26, 2012, 12:24:21 PM »
Basiclly what I got is inserting blocks so they are inserted on correct layer among other things where they want text to always stay horizontal. So I thought I would use a dymanic block with rotation parameter and action and add a user parameter to where they could set what they wanted the end result of text to be rotated at.
 
I guess another route would be to script insert command to get alignment parameter taken care of and once ended check if it contains user parameters and if so update it then, but it seems I keep hitting roadblocks getting it work from toolpalette and from Insert command so thought maybe roll my own where it called same command from tool palette.
 
P.S.
I do not feel near close enough to understanding API to charge anyone for my services, and just some automation for company I work for after regular hours. I leave that to you pros.

TheMaster

  • Guest
Re: Jigging a block with Alignment parameter
« Reply #20 on: November 26, 2012, 09:57:02 PM »
Basiclly what I got is inserting blocks so they are inserted on correct layer among other things where they want text to always stay horizontal. So I thought I would use a dymanic block with rotation parameter and action and add a user parameter to where they could set what they wanted the end result of text to be rotated at.
 
I guess another route would be to script insert command to get alignment parameter taken care of and once ended check if it contains user parameters and if so update it then, but it seems I keep hitting roadblocks getting it work from toolpalette and from Insert command so thought maybe roll my own where it called same command from tool palette.
 
P.S.
I do not feel near close enough to understanding API to charge anyone for my services, and just some automation for company I work for after regular hours. I leave that to you pros.

Another way to do that might be to script the INSERT command while a DrawableOverrule keeps the text heads-up. Of course, it could also keep the text heads-up whenever the block is edited in any way, if you wanted to do that as well.


Jeff H

  • Needs a day job
  • Posts: 6150
Re: Jigging a block with Alignment parameter
« Reply #21 on: November 27, 2012, 12:15:26 AM »
Basiclly what I got is inserting blocks so they are inserted on correct layer among other things where they want text to always stay horizontal. So I thought I would use a dymanic block with rotation parameter and action and add a user parameter to where they could set what they wanted the end result of text to be rotated at.

I guess another route would be to script insert command to get alignment parameter taken care of and once ended check if it contains user parameters and if so update it then, but it seems I keep hitting roadblocks getting it work from toolpalette and from Insert command so thought maybe roll my own where it called same command from tool palette.

P.S.
I do not feel near close enough to understanding API to charge anyone for my services, and just some automation for company I work for after regular hours. I leave that to you pros.

Another way to do that might be to script the INSERT command while a DrawableOverrule keeps the text heads-up. Of course, it could also keep the text heads-up whenever the block is edited in any way, if you wanted to do that as well.
Thanks Tony,

That was how I intially tried but one functionality that I was trying to add was to run through drawings for project and creating a legend in a 2 column table with one column being the block and the other using the description.

The other downfall and I can be wrong was to make the text persistent once saved. Most of the time the drawings are sent to a client and once they receive them I do not care if the text does not rotate and do not want worry about them having the code, so I thought using attributes would be the best so if the client rotated a block they had to could manually set attribute rotation to 0.
So through adding event for BeginSave and setting the rotation was one way, but using attributes(and probably due to the way i was doing it) was the grip points remained at the position that they would normally be drawn, and I did not investigate far enough if I needed to set some flag or add a grip overrule to make match.

Also I thought adding by using a Xdata which if attached to AttributeDefinition will be added to the AttributeReference using 'INSERT' command, which I thought also would give me the ability to add additional rotation values to rotate to the UCS, so 0 would be horizontal or if they wanted the text to always be 90 then 90, etc...
Well inserting a block from a tool palette does attach xdata from a AttributeDefinition to a AttributeReference, and 'ATTSYNC' kills the Xdata also.

So I thought if I have write a command to jig from tool palette might as well do use it for regular insertion.
Since I can not find or do not know where to find documentation to get a decent explanation of the fundamental workings of the graphics engine and how or what goes on that effects how a entity is drawn I said the hell with it and just use a dynamic block.
So I thought well why not just handle the rotation for insertion through a jig and when transformed using a TransformOverrule.
As far as Dynamic properties in a TransformOverrule just checking if DynamicBlockReferencePropertyCollection == null throws an error but as long as I bail out if IsNewObject == true it seemed to work.
Of course when I think I am just getting close other issues will pop up where a total hack or complete new plan attack will be in store.