TheSwamp

Code Red => .NET => Topic started by: vnsharifi on April 01, 2011, 12:23:30 AM

Title: Need Help Urget - will pay.
Post by: vnsharifi on April 01, 2011, 12:23:30 AM
I am too busy and need some help.  Anybody interested for a little bit side work, I would be appreciated and besides  I can give you more jobs if we can work together .it is very easy job  if you have  some  already written modules and routines.  My Email is Vahids@3web.com. I will pick the lower bids .


Give me the price and I will pay by PayPal, in 3 payments as follow.

20%- up to step 3

40%- at step 7

40%- after finishing.

Here is Project:

 

There is a dynamic block name  “ test 1“  which looks like a  U  . Three  lines . all legs are stretchable and has grip points .

 

Code requirement is :

1-Program should be in vb.net compatible with autocad 2010  or c sharp.

2-After insertion of  “test1”  by user. Program  prompt for another point and   a text should  be placed on second point, showing the length of 3 lines  separated with comma, with 2 decimal points.

3-If user edit the text values, the block should automatically adjust the length.

4-User are not allowed to change the name of “test1” dynamic block but other blocks are allowed.

5-User are not allowed to explode   block  “test1”. But other blocks should be  explodable.

6-If user delete the  text ,the block should be deleted automatically . And vice versa.

7-Double click on block or text bring a message box showing  the  length of lines.

8-When user stretch the lines using  grips , the text should be updated with new lengths accordingly.

9- need a new command- which are able to associate  any object on drawing  to that block. By Associate  I mean if user delete original text or block all associated objects would be deleted and even if user double click on new associated object it will bring that  message box on screen.

 

Email me you offers and I will get back to you when I got enough  volunteers. Thanks

 

David.

Title: Re: Need Help Urget - will pay.
Post by: Kerry on April 01, 2011, 12:49:45 AM

I'll play the game ..

I see you added C# after your post at ADDG :)


How much do YOU think it's worth to you ??



 
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 13, 2011, 01:16:35 AM
Kerry,
Thanks for reply, yes I added c#, Because all Pros writing in c#, I barely even know vb, But this company i am working with , not using very
complicated stuff in autocad. I just relaized there are a couple websites which I could use to convert the code to vb.
regard with other question ,how much does  it worth to me??
Well to be honest. It worth my job . because if i can't write this part  by end of summer they will let me go.
This forum is a educational forum. let's not put business into this,please.
I was kind of ashamed to put my first post here.
email me at vnsharifi@gmail.com please.
David(vahid)
Thanks
Title: Re: Need Help Urget - will pay.
Post by: Kerry on April 13, 2011, 01:47:54 AM

Do you have the Dynamic block built ??

I don't believe a program conforming to your specifications can be build in .NET, or lisp (com based) .
Perhaps ObjectARX using custom objects would satisfy parts of your requirements.



Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 13, 2011, 08:26:05 PM
Kerry,
Thanks for Reply. Yes the block is already built
 That u shape is a fiber Glass construction material. It could be any shape. the reason I said dynamic block  is , on drawing user may want to put a top view or side view or plan view of shape.
But that is just graphical part of it in AutoCAD.
So user inserts that block inside drawing. Before insertion a dialog pops up and user should fill in 80 fields. It contain some specification, to build that, in shop, like how many, coat color, strength, type of saw should be used, which city to be delivered and so on.
The other programmer who was replaced by me created  an user define objects and hold all graphical shapes and information inside the drawing like you suggested . It is working but very slow. I have no clue about object ARx. So I have no right to judge him. But I know in a drawing file we could have 1000 of these shapes on top of all other object s in drawing. So speed is very important
Now on my interview I suggested, to have and external database but synced. They liked the idea and I was hired. Now I am in deep ……
So what I am thinking is when I insert the block all 80 fields to be exported to MDB database which would be handled inside AutoCAD by using SQL Scripts.
Now if I double click on u shape all those 80 fields should be extracted from database and shown on a dialog on AutoCAD. If I erase that U shape from drawing the record should be erased from database. If I change the length of those legs, the same, if I copy that, in database it should create another record.  Shape should have a name on drawing which is attached to shape on drawing, that name is not necessarily   unique. Like we could have 2 Kerry’s in Dallas but they don’t have the same Social security number. But label (name) and shape are always connected 
That‘s it. Now what do you think? Shall I look for another job? Heheheheheheh.
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 13, 2011, 09:42:32 PM
Now on my interview I suggested, to have and external database but synced. They liked the idea and I was hired. Now I am in deep ……


So they thought it was too slow storing information in  1 database and to speed it up store it in 2 databases's?
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 13, 2011, 10:48:58 PM
Jeff it was my Idea and I make them believe, it would work. God knows. Because I personally don't know.
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 13, 2011, 10:57:59 PM
Maybe if you posted what the first programmer created in the ARX forum or send to some people private they will probably take a look at it for you.
Title: Re: Need Help Urget - will pay.
Post by: LE3 on April 14, 2011, 11:12:39 AM
Quote
The other programmer who was replaced by me created  an user define objects and hold all graphical shapes and information inside the drawing like you suggested . It is working but very slow. I have no clue about object ARx. So I have no right to judge him. But I know in a drawing file we could have 1000 of these shapes on top of all other object s in drawing. So speed is very important
Now on my interview I suggested, to have and external database but synced. They liked the idea and I was hired. Now I am in deep ……

- On what programming language the original application was developed?
- Why don't you try first to update the code, find the drawbacks and see if it is possible to work from there, instead from scratch?
- It is better to be honest in your interviews, when you do not know tell them.


Good luck!
Title: Re: Need Help Urget - will pay.
Post by: T.Willey on April 14, 2011, 11:25:50 AM

Do you have the Dynamic block built ??

I don't believe a program conforming to your specifications can be build in .NET, or lisp (com based) .
Perhaps ObjectARX using custom objects would satisfy parts of your requirements.

I would assume it could be done with Extension Dictionaries, and Object Reactors.  The reactor part would depend on how dynamic blocks work.  Like if they change handles or what then they get edited.  The extension dictionary would store the data within the drawing.  No need for an external database, and if the object get deleted, then so does the information associated with it from the drawing.
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 14, 2011, 05:41:36 PM
Thank you gentlemens for all nice advices ,
Still I am waiting for an offer.
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 14, 2011, 05:53:07 PM
Tim Willey, Thanks for looking and reading.
Are your really  into this? If you think it is doable
Could have  we a deal ? Others made comment but so far
I think they are review the project.
I know it is hard. I don't have that experience to do this part.
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 14, 2011, 06:09:05 PM
Mr LE ,
The original program   was created in ObjetArx. the original code was disappeared after he was laid off.
I was honest, to my common sense, it is doable. I know and am pretty sure it is doable even if in vb.
It was a matter of time and I didn't expect a dead line.
Now if you think it is doable and you have that experience  just roll up the sleeve and give me a hand and I am willingly share
what I am earning with you.
Title: Re: Need Help Urget - will pay.
Post by: LE3 on April 14, 2011, 06:18:46 PM
Mr LE ,
The original program   was created in ObjetArx. the original code was disappeared after he was laid off.
I was honest, to my common sense, it is doable. I know and am pretty sure it is doable even if in vb.
It was a matter of time and I didn't expect a dead line.
Now if you think it is doable and you have that experience  just roll up the sleeve and give me a hand and I am willingly share
what I am earning with you.

Two weeks earlier, I would take it... but can't right now.

I write code also in ObjectARX and it is very strange that the original application it is running very slow, BTW.
Title: Re: Need Help Urget - will pay.
Post by: T.Willey on April 14, 2011, 06:42:58 PM
I think it could work, but I don't have a working computer at home right now, so I don't want to say I could do it.  Hope you find someone to help though.
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 14, 2011, 07:30:35 PM
Thanks  everybody for listening.
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 14, 2011, 07:52:45 PM
I got some ideas but how about we do as a group project and money could be donated to the Swamp.

Some issues would be
If OP did not want the code to be publicly shown and logic or solution hidden as that would keep the Swamp from gaining probably some good learning resources. One answer would be for code not to be posted price would be $89,987.23

But could be a good learning expirence and throw some money to the swamp.

Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 14, 2011, 08:57:23 PM
I love you Gentlemen. I go with second option Jeff. Code could be visible for everybody as a learning resource here in this web site.
Since I am pretty sure if you experts work together this is a finished project. I am willing to start with deposit.
Tell me how much and what Email address Jeff ( As for Paypal).
I knew God will send somebody to help me.
Title: Re: Need Help Urget - will pay.
Post by: Kerry on April 14, 2011, 09:21:10 PM
vnsharifi'
The first things YOU should do are ;

Provide details of the AutoCAD version.
If the ARX source is not available the routine you have will be ONLY able to run in 3 builds of Autocad ... this should be considered.

Provide a FULL specification of what you
a: Definitely need
b: Would like to have as a bonus.

Post the Block
.. and perhaps some sample drawings.

I do have some concerns.
You have obviously lied to your employer to gain employment.
What have you done to date about developing an application ?
Please don't feel that you need to make donations to theSwamp to receive help.
Please don't expect that a donation will cause busy/committed people to feel obliged to help.

Regards,
Title: Re: Need Help Urget - will pay.
Post by: LE3 on April 14, 2011, 09:33:56 PM
$89,987.23
Aha....  :evil:  :roll:  :lol:
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 14, 2011, 10:57:45 PM
Sorry about previous post, I hope it was not taken that you must donate for help but I can see how it could,

but the best option as Kerry mentioned would be to start developing the application and when you hit snags or need guidance to ask the Swamp.

That way it cost you nothing but most importantly you gain the expirence and knowledge from designing the application, and will help with better decisions when company asks for other services.


If someone created a application based on your first description, after reading your description in the more recent post you looks like you would have paid for something that would basiclly make your employer mad.

If you want to pay someone for professional services and a professional job I would suggest creating detailed documention on exactly what is expected.









Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 15, 2011, 02:25:28 AM
Giving you gentlemen a brief  story of   what is going  on .
Material for these shapes are Fiberglass and being used around openings ,Like  windows and doors,  to attach precast concrete (those fancy shapes )  to main  structure elements, in high rise buildings. They have a lot of shapes in their production units (Shop).    S, T, U, Z, Box, Circle, Diamond, and so on. Almost 40 typical shapes. But sometimes they are untypical. Machines are limited to accept only 12 dimensions.  Machines will import all information from Excel and will automatically make all those shapes.
What they are doing right now is, they copy architect drawing and start to put some label  or Tags around openings. These labels are unique. Let’s say designer will put a MK001 for top of a window,MK002 for left side , MK003 for right side  and MK004 for bottom side of window. Designers have their own rules to pick the right shape and diameter and color and length. No clue how.
Then all data would be inputted in Excel manually. Tags(Mark or Label ),  Number of items for that label, Color, Diameter, 12 dimensions, shape code ,  main contractor, strength, density, and so on. Total number of these files is 80. Some of data in that excel sheet would be used for billing and some of them to be used in fabrication and some of them for management.  But all data are initiated by designer in Excel sheet.
 The shop will create those shapes and a tag would be attached to bundle   and will be sent to Job site. Foreman open drawings, read the Tags,   will find the bundle with right tag and start installing.
Since they are doing this manually they have no control over Tags. They start from 1 and going up.
Sometimes   in 2 different windows they use the same shape and number and dimensions and they can’t combine this. The consequence of this manual operation is, they have a lot of extra labels (Tags) which really are the same.  It will cause extra work for shop and extra work in job site to find those tags and lots of confusion.
Giving you an idea, for a project it could be a big truck with 1000 labels (Tags).
My plan is, making 40 different dynamic blocks and using those in program.
I will simplify the situation in just one shape which is U shape. I need your help just for one shape, then I will expand it for other shapes.
=================================================
Regard to your Questions and comments.
A-Regard the lie. I didn’t know they will give me a short time. If I had more time I could’ve educated myself. I can do this if I had more time. Jeff and Tony helped me a lot before on Autodesk discussion. This is not my attitude. I struggle then ask for help.
B-To date , I linked AutoCAD to external database. Right now if I draw an object in AutoCAD all the properties could be exported to Access(MDB file) like color ,layer,length,Object name and  . All user forms are designed. All reports query is done. 
C-AutoCAD is 2010 and 2011. Not LT.
D-I don’t need any bonus.
E-What I need is really beyond my knowledge at this short time. I can’t even start it. How to link objects together and those events. I definitely need:
=====================================================
1-   Need 3 commands.  Let’s call them   AAA and BBB and CCC.
2-   By Entering AAA a form pops up, 3 text boxes and a OK button on it. Asking for 3 legs of U bar. If 3 text boxes left blank, after pressing OK , user prompt to pick  start point of leg 1 and direction ,and then asking for leg 2 length and direction ( user are not allowed for any other angle other than 90, since this is supposed to be U shape , and finally the last leg,  3 dummy lines would be drawn on screen to allow user to see what the shape  looks like, by picking  3rd point all those 3 dummy lines would be replaced by actual dynamic block. If user fills the lengths in textboxes on form then  after pressing ok program will prompt just for insertion point and angle of block and block would be place with right leg lengths. If user left any leg  length blank in text boxes program should ask for that leg on drawing. If in the middle of this step  user press cancel then program will carry to next step
3-   User is prompted to pick a point and an angle on screen for putting text. Let’s put Object ID in that text and call It JJTEXT. Something unique which would be a Unique ID in the external Access Database? This JJTEXT would be a record in external Database. I have a question here. Is it true after any drawing closing and opening Object ID’s would be changed? If that is a case I need a unique number for JJTEXT,to be able to be connected to external Database.
4-   By executing BBB command, user are able to attach more objects  to  JJTEXT.  It could be any objects and it could be 20 of them tops.
5-   If user trying to copy any of these linked objects, then a message box needed. The whole idea is user should be aware they are not regular AutoCAD objects. And if user confirms the copy, then again a message box needed showing Object ID. So this will trigger another subroutine  for another export to external Database.
6-   By executing command CCC, user prompted to pick any of linked objects and then prompted to pick a point and angle and then the block would be placed, using the dimensions of original JJTEXT,nothing will be exported.
7-   If user double click on JJTEXT or  Block or those additional linked objects, Then main forms pops up and if user change dimension then legs would be changed on drawing accordingly, Even for those block which were inserted by command CCC.
8-   If user trying to delete any of these linked objects then all of them should be deleted from drawing  and then need a message box for JJTEXT object ID, So I can find it in external Database and delete it.
9-   If user trying to change the legs either  by using  grips or stretch, then need a message box again showing the JJtext Object ID, So I can check the external Database and update the record there.
10-   Blocks could not be exploded or renamed.


.

Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 15, 2011, 02:38:53 AM
Not too much.and I know I don't have to. See uploaded file.
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 15, 2011, 04:06:48 AM
I hope I did not say anything that made you feel you needed to donate or,
made you think a donation would result in anyone developing the application for you.

but is this drawing a basic idea or is some of the concepts you are looking for.


If you change length of line the text updates after regen not both ways
Moves the text seperate from block
Text and Block(Both are part of Block) delete at same time etc......
To add more insert Ushape1

Use REGEN to update the lengths!
Title: Re: Need Help Urget - will pay.
Post by: Mark on April 15, 2011, 04:13:36 AM
Not too much.and I know I don't have to. See uploaded file.

Thanks for the donation! I'll add you to the list of donors. 8-)
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 15, 2011, 04:54:07 AM
This will change all lengths with Distance1 parameter to 25

just testing and seeing what is avaiable through .NET API

I guess this is the only way to access the these properties


Code: [Select]

 [CommandMethod("DynamicBlocksThingy")]
            public void DynamicBlocksThingy()
            {
                Document doc = Application.DocumentManager.MdiActiveDocument;
                Database db = doc.Database;
                Editor ed = doc.Editor;

                using (Transaction trx = db.TransactionManager.StartTransaction())
                {

                    BlockTable bt = db.BlockTableId.GetObject(OpenMode.ForRead) as BlockTable;
                    foreach (ObjectId objId in bt)
                    {
                        BlockTableRecord btr = (BlockTableRecord)objId.GetObject(OpenMode.ForRead);

                        if (btr.IsDynamicBlock)
                        {
                            ObjectIdCollection brefObjidColl = btr.GetBlockReferenceIds(true, true);
                            ObjectIdCollection anonObjIdsColl = btr.GetAnonymousBlockIds();

                            foreach (ObjectId anonObjId in anonObjIdsColl)
                            {
                                BlockTableRecord btrAnon = (BlockTableRecord)anonObjId.GetObject(OpenMode.ForRead);
                                ObjectIdCollection ObjidColl = btrAnon.GetBlockReferenceIds(true, true);
                                foreach (ObjectId Id in ObjidColl)
                                    brefObjidColl.Add(Id);
                            }

                            foreach (ObjectId brefObjId in brefObjidColl)
                            {
                                BlockReference bref = brefObjId.GetObject(OpenMode.ForWrite) as BlockReference;
                                DynamicBlockReferencePropertyCollection dynBrefColl = bref.DynamicBlockReferencePropertyCollection;
                                foreach (DynamicBlockReferenceProperty dynBrefProps in dynBrefColl)
                                {
                                    if (dynBrefProps.PropertyName == "Distance1")
                                    {
                                        dynBrefProps.Value = 25.0;
                                    }
                                }
                            }
                        }
                    }


                    trx.Commit();
                }
            }


Need to start planning and testing on how to link objects
Title: Re: Need Help Urget - will pay.
Post by: LE3 on April 15, 2011, 10:28:55 AM
Quote
The original program   was created in ObjetArx. the original code was disappeared after he was laid off.
^
Something that I don't see right or buy:
- What happen to the source code?, was not own by the company?
- If it is/was why they don't ask to get it back?
- Don't think that a corporation or company will simple leave that without doing anything.
- I have done several projects/solutions and all of the contracts agreements, there is a clause about giving them 90 days after termination, to keep track or backup of their solutions.

Are you going to mention to them about using TheSwamp as a resource? and that will be getting help here?

After the above, post a drawing or image sample of the desired or final output/result product - I am just curios.

Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 15, 2011, 04:04:13 PM
I hope I did not say anything that made you feel you needed to donate or,
made you think a donation would result in anyone developing the application for you.

but is this drawing a basic idea or is some of the concepts you are looking for.


If you change length of line the text updates after regen not both ways
Moves the text seperate from block
Text and Block(Both are part of Block) delete at same time etc......
To add more insert Ushape1

Use REGEN to update the lengths!



Jeff
That donation was unnoticeable and was just to help this site to be alive.
You helped me several time before and I learned from you.
The basic Idea is right. That is almost what I want.
Thanks again .


Yes Je
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 15, 2011, 04:21:57 PM
Quote
The original program   was created in ObjetArx. the original code was disappeared after he was laid off.
^
Something that I don't see right or buy:
- What happen to the source code?, was not own by the company?
- If it is/was why they don't ask to get it back?
- Don't think that a corporation or company will simple leave that without doing anything.
- I have done several projects/solutions and all of the contracts agreements, there is a clause about giving them 90 days after termination, to keep track or backup of their solutions.

Are you going to mention to them about using TheSwamp as a resource? and that will be getting help here?

After the above, post a drawing or image sample of the desired or final output/result product - I am just curios.





I guess my comment was not read. This company is a old fashion company. The machine, they are using in
the Production, to read excel is a 486 processor.
Personally My father has no clue about what is source code and what is a compiled executable Code.
when he left company , what he gave owner  was a cd. No contact . No nothing.
Even the program is designed just to work on 2 machines,How  No clue.I decided to update the O.S.
After  formatting Hard drive,the program didn't work. I think it reads the Hard drive somehow. I am scared to
touch the other one. That is what is going on.
These guys used to do everything by hand.
And I am a victim here with a time limitation. I am not gonna mention do them I got help here.
I am honest.If you are on job and reading a book to get help.Do you mention it?
If I get a right start up here, it is like reading a book.
Personally I don't see any vb.net book around Market.
Except for Jerry's book which I bought and could understand it .
I learned more just by pating the code from forums and play with them .
So please be positive and try to help me and my family.


Title: Re: Need Help Urget - will pay.
Post by: dgorsman on April 15, 2011, 05:34:09 PM

I am not gonna mention do them I got help here.
I am honest.


 :roll:

This is going to sound harsh, but it really is the best thing to do and will help you later: TELL THEM YOU CAN'T DO IT.  NOW.
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 15, 2011, 09:06:13 PM
Personally My father has no clue about what is source code and what is a compiled executable Code.
when he left company , what he gave owner  was a cd. No contact . No nothing.

Did your dad write the original Application?
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 16, 2011, 06:49:33 AM
Jeff, I was joking around to tell This  "LE" , That,  owner of this company is very old and has no  clue about Computer.
The programmer took advantage of this and never give them source code. Are you teasing me !!!!!! ?
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 16, 2011, 07:00:13 AM
Are you teasing me !!!!!! ?
Not at all,

Personally My father  has no clue about what is source code and what is a compiled executable Code.
when he left company  , what he gave owner  was a cd. No contact . No nothing.

Reading this,
I assumed your father use to work at that company and when he left he gave the owner a CD with the compiled ObjectARX application.

I was just wondering if he wrote it.


 

Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 16, 2011, 07:18:13 AM
Are you teasing me !!!!!! ?
Not at all,

Personally My father  has no clue about what is source code and what is a compiled executable Code.
when he left company  , what he gave owner  was a cd. No contact . No nothing.

Reading this,
I assumed your father use to work at that company and when he left he gave the owner a CD with the compiled ObjectARX application.

I was just wondering if he wrote it.


 


You are right , Again Grammer Error, Sorry.
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 16, 2011, 07:33:01 AM
..... That,  owner of this company is very old and has no  clue about Computer.
The programmer took advantage of this and never give them source code......


Good thing  you work there,
You can keep people from taking advantage of him when it comes to compter related issues.


..................ehhhhhhh
nevermind

Jeff it was my Idea and I make them believe, it would work. God knows. Because I personally don't know.


Now that was teasing. :-)
I am just joking around.
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 16, 2011, 07:44:58 AM
I know nothing abut Extension Dictionaries.   But before I start reading about extension
Dictionary, I have a question. Sql is very powerfull and programmer have any control over database, Like sorting, providing different reports,
filtering,searching and lots of other things . Just by a short Sql statement. Now If I store all those extra 80 fields, in Extension Dictionary.
Will I have all those  tools which I have with Sql ?
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 16, 2011, 08:05:04 AM
Thanks Jeff , I translated Your  Code to Vb( Using those Web Tools , I have no Idea about C#) , and code is working.
The hard part is a connection between 2 objects. I am just struggle to find a way to link 2 different objects on drawing.
How would it be possible? something similar to group command in autocad.
But we need some common  Identification for all objects inside the group.  What is that Identifiation?
I thought maybe a uniqe group name will help. Like when user change something. program looks to find what group it belongs to ?
This is  basic thing I am thinking. Any idea ?


Below is Jeff code in Vb. This would be one of my Function in Future Program for sure.
==============================

Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Module JeffCode1
    <CommandMethod("DynamicBlocksThingy")> _
    Public Sub DynamicBlocksThingy()
        Dim doc As Document = Application.DocumentManager.MdiActiveDocument
        Dim db As Database = doc.Database
        Dim ed As Editor = doc.Editor
        Using trx As Transaction = db.TransactionManager.StartTransaction()
            Dim bt As BlockTable = TryCast(db.BlockTableId.GetObject(OpenMode.ForRead), BlockTable)
            For Each objId As ObjectId In bt
                Dim btr As BlockTableRecord = DirectCast(objId.GetObject(OpenMode.ForRead), BlockTableRecord)
                If btr.IsDynamicBlock Then
                    Dim brefObjidColl As ObjectIdCollection = btr.GetBlockReferenceIds(True, True)
                    Dim anonObjIdsColl As ObjectIdCollection = btr.GetAnonymousBlockIds()
                    For Each anonObjId As ObjectId In anonObjIdsColl
                        Dim btrAnon As BlockTableRecord = DirectCast(anonObjId.GetObject(OpenMode.ForRead), BlockTableRecord)
                        Dim ObjidColl As ObjectIdCollection = btrAnon.GetBlockReferenceIds(True, True)
                        For Each Id As ObjectId In ObjidColl
                            brefObjidColl.Add(Id)
                        Next
                    Next
                    For Each brefObjId As ObjectId In brefObjidColl
                        Dim bref As BlockReference = TryCast(brefObjId.GetObject(OpenMode.ForWrite), BlockReference)
                        Dim dynBrefColl As DynamicBlockReferencePropertyCollection = bref.DynamicBlockReferencePropertyCollection
                        For Each dynBrefProps As DynamicBlockReferenceProperty In dynBrefColl
                            If dynBrefProps.PropertyName = "Distance1" Then
                                dynBrefProps.Value = 25.0
                            End If
                        Next
                    Next
                End If
            Next
            trx.Commit()
        End Using
    End Sub
Code: [Select]
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 16, 2011, 08:27:53 AM
I am just struggle to find a way to link 2 different objects on drawing.

Here is a 4 part seris that might give you some ideas or help

From
Through the Interface
Linking Circles, Part 1: Using .NET events to relate AutoCAD geometry (http://through-the-interface.typepad.com/through_the_interface/2006/11/linking_circles.html)
Linking Circles, Part 2: Getting persistent (http://through-the-interface.typepad.com/through_the_interface/2006/11/linking_circles_1.html)
Linking Circles, Part 3: Automatic linking on circle creation (http://through-the-interface.typepad.com/through_the_interface/2006/12/linking_circles_1.html)
Linking Circles, Part 4: Adding 3D (http://through-the-interface.typepad.com/through_the_interface/2006/12/linking_circles.html)

Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 16, 2011, 09:16:32 AM
Here is a 4 part seris that might give you some ideas or help
[/quote]

Thanks Jeff, I started to translate them  to vb. I believe that is what I want.
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 16, 2011, 09:21:54 AM

GentleMen.
My intention  was to export ObjectID to an Access file upon creation any new objects in Autocad.
Now after file beeing close and reopen again , ObjectIds doesn't stay the same.
Now How would I find that Object in Access file?
What other permanent  unique number I could use to make a  link between objects in atuocad and objects outside of autocad ( Like Acess)?

Title: Re: Need Help Urget - will pay.
Post by: Lee Mac on April 16, 2011, 09:26:29 AM
What other permanent  unique number I could use to make a  link between objects in atuocad and objects outside of autocad ( Like Acess)?

Object Handle.
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 16, 2011, 11:06:46 AM
What other permanent  unique number I could use to make a  link between objects in atuocad and objects outside of autocad ( Like Acess)?

Object Handle.
Thanks Lee ,
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 16, 2011, 11:29:21 AM
Object Handles are not unique across different drawings.

Although what good is a handle if you do not know what drawing the object for the handle is in. So with drawing info & handle you can store it uniquley
Title: Re: Need Help Urget - will pay.
Post by: fixo on April 16, 2011, 12:23:12 PM
From docs

Work with ObjectIds
 
 
 
Each object contained with in the Database object is assigned several unique ids. The unique ways you can access objects are:

Entity handle
ObjectId
Instance pointer
The most common method is to access an object by its Object Id. Object Ids work well if your projects utilize both COM interop and the managed .NET API. If you create custom AutoLISP functions, you may need to work with entity handles.

Handles are persistent between AutoCAD sessions, so they are the best way of accessing objects if you need to export drawing information to an external file which might later need to be used to update the drawing. The ObjectId of an object in a database exists only while the database is loaded into memory. Once the database is closed, the Object Ids assigned to an object no longer exist and maybe different the next time the database is opened.
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 16, 2011, 03:09:24 PM
Thanks Fixo.
I am really glas so many people trying to help me here.
I decided to work with handle. Because when I close drawing and reopen it again. handles stage the same.
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 16, 2011, 07:50:29 PM
I found this piece of code in VBA regarding SetXdata and GetXdata. My qeustion is why , when we setxdata to an object. It doesn't hold the
values , after closing the drawing. Am I missing something ? or it is that way.
Code: [Select]

Dim entry As AcadEntity
  Dim XDataType(0 To 2) As Integer
  Dim XData(0 To 2) As Variant
  Dim temp(20) As Variant
Sub getextendeddata()
For Each entry In ThisDrawing.ModelSpace
  entry.getXdata "Test_Application", XDataType, XData
    temp(1) = ""
    For i = 0 To 2
    temp(1) = temp(1) + XData(i) & vbCrLf
    Next
    MsgBox temp(1)
Next
End Sub
Sub setextendeddata()
For Each entry In ThisDrawing.ModelSpace
    XDataType(0) = 1001: XData(0) = "Test_Application"
    XDataType(1) = 1000: XData(1) = "A"
    XDataType(2) = 1000: XData(2) = "B"
    entry.setXdata XDataType, XData
Next
End Sub
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 16, 2011, 10:08:52 PM
GentleMen,
I have another Question, I found the maximus fields per record in dictionaries is 9  . Is it true?
Title: Re: Need Help Urget - will pay.
Post by: Kerry on April 16, 2011, 10:31:09 PM

Quote from: http://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.80).aspx
The capacity of a Dictionary is the number of elements the Dictionary can hold. As elements are added to a Dictionary, the capacity is automatically increased as required by reallocating the internal array.

What is it you are trying to do ?

Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 16, 2011, 10:44:17 PM

Quote from: http://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.80).aspx
The capacity of a Dictionary is the number of elements the Dictionary can hold. As elements are added to a Dictionary, the capacity is automatically increased as required by reallocating the internal array.

What is it you are trying to do ?



Kerry, thank you for reading and listening. Trying to see if it is possible to keep the database inside the drawing instead of outside.
By using dictionaries. I need 80 fields per record . But more than 9 , It gives me error. I usually test in vba . Then move it to Vb.net.
Below is code in VBA.



Code: [Select]

Public Sub writeXrec1()
  Dim oDict As AcadDictionary
  Dim oXRec As AcadXRecord
  Dim dxfCode(0 To 80) As Integer
  Dim dxfData(0 To 80)
    Set oDict = ThisDrawing.Dictionaries.Add("SampleTest")
     For i = 0 To 1000
      Set oXRec = oDict.AddXRecord("Record" + Trim(str(i + 1)))
      For J = 0 To 80
        dxfCode(J) = J + 1: dxfData(J) = Trim(str(J)) + "value"
      Next J
      oXRec.SetXRecordData dxfCode, dxfData
    Next i
  MsgBox "DONE"
End Sub



Title: Re: Need Help Urgently - will pay.
Post by: Kerry on April 16, 2011, 10:51:47 PM
Quote
Trying to see if it is possible to keep the database inside the drawing instead of outside.

Why ?
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 16, 2011, 10:57:50 PM

Quote
Trying to see if it is possible to keep the database inside the drawing instead of outside.

Why ?

1- I did a speed test for writing 1000 records (each record 9 fields). It was so fast inside autocad .
2- If I go with  external database, If users want to transfer files to each other, They have to transfer 2 files. One "dwg" and one "MDB".


Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 16, 2011, 11:06:34 PM
Quote
ObjectARX, .NET and ObjectDBX modules

XDATA and extension dictionaries provide a means of augmenting database objects with data and other objects (via hard ownership). Both the XDATA facilities and extension dictionaries are intended to be used by multiple applications as needed. XDATA has a limitation of 16K bytes per object, to be shared by all applications.

For objects that are accessible by all applications, such as entities in block table records and symbol table records, applications should not consume more than 2K bytes of XDATA, and must not consume more than 4K bytes of XDATA. If they need more data than this, consider moving the data to a custom object or an AcDbXrecord in the extension dictionary.

Extension dictionary entries have no maximum size restriction, but there is a memory tradeoff in using extension dictionaries in AutoCAD. Each extension dictionary entry consumes a minimum of 250 bytes of overhead beyond the object state during program execution, whereas each REGAPP in an objects's XDATA consumes about 40 bytes of overhead.

Some objects are private by nature; they are meant to be manipulated only by the application that creates and manages them. Using XDATA and extension dictionaries on private objects is not restricted.



Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 16, 2011, 11:17:00 PM
Quote

Each extension dictionary entry consumes a minimum of 250 bytes of overhead beyond the object state during program execution,





Thanks Jeff for considering ,  it doesn't tell  about field limitation in each record. I Know we could have unlimited records in a dictionary.I tested it.If you try the code I submitted. It doesn't allow more than 9 fileds. Even with Bolean data type. If You confirm this test I guess I have to stick with External Database.
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 16, 2011, 11:26:43 PM
If You confirm this test I guess I have to stick with External Database.
I just realized I do not know how to build or load VBA.

Just so you know if you save ObjecID's in a ExtensionDictionary, when you open the drawing AutoCAD will update ObjectIds--(ObjectId value is its address which contains a pointer to the actual object)
to reflect the new memory location.
Title: Re: Need Urgent Help - will pay.
Post by: Kerry on April 16, 2011, 11:37:16 PM

Quote
Trying to see if it is possible to keep the database inside the drawing instead of outside.

Why ?

1- I did a speed test for writing 1000 records (each record 9 fields). It was so fast inside autocad .
2- If I go with  external database, If users want to transfer files to each other, They have to transfer 2 files. One "dwg" and one "MDB".




That doesn't answer the question.


Why do you want an internal dictionary ?


Please consider this :
How will you transfer the information to the shop floor ?

Why do you want a database ?

At what stage in the drawing design will the data extracted from the drawing be usable in any real manner?

How often is each profile likely be changed?

If you analyse your data is it generally several profiles with the specific end conditions repeated many times for varying lengths ?

If you want an external database it's data can be updated at any time from the drawing.

//--------

Because you have not provided sufficient information to indicate  to anyone here what your real intention is you are making it VERY difficult for anyone to actually help in any way other than teach you programming.

... also, you seem to be jumping all over the place with your testing and code snips.
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 17, 2011, 12:27:31 AM
If You confirm this test I guess I have to stick with External Database.
I just realized I do not know how to build or load VBA.

Here you go Jeff: I made it vb.net.
Code: [Select]

Imports Autodesk.AutoCAD.Interop.Common
Module testDictionaries
    Dim i, J As Integer
    Dim countdic As Integer
    Dim dicname As String
    Dim oDict As AcadDictionary
    Dim oXRec As AcadXRecord
    Dim no_of_records As Integer
    Public Sub create_records_in_Dictionary()
        no_of_records = InputBox("number of fiels per record?")
        Dim dxfCode(no_of_records) As Int16
        Dim dxfData(no_of_records) As Object
        oDict = ThisDrawing.Dictionaries.Add("SampleTest")
        For i = 0 To 1000
            oXRec = oDict.AddXRecord("Record" + Trim(Str(i + 1)))
            For J = 0 To no_of_records
                dxfCode(J) = J + 1 : dxfData(J) = Trim(Str(J)) + "value"
            Next J

            oXRec.SetXRecordData(dxfCode, dxfData)

        Next i
        MsgBox("DONE")
    End Sub
    Public Sub SHOW_ALL_dictionary_names_in_file()
        countdic = ThisDrawing.Dictionaries.Count
        dicname = ""
        For i = 0 To countdic - 1
            Try
                oDict = ThisDrawing.Dictionaries.Item(i)
                If Left(oDict.Name, 5) <> "ACAD_" Or Trim(oDict.Name) = "" Then
                    dicname = dicname + oDict.Name + vbCrLf
                End If
            Catch ex As Exception
                GoTo 100
            End Try
100:    Next
        MsgBox(dicname)
    End Sub
    Public Sub DELETE_extra_DICTIONARY()
        Dim oDict As AcadDictionary
        countdic = ThisDrawing.Dictionaries.Count
        For i = 0 To countdic - 1
            Try
                oDict = ThisDrawing.Dictionaries.Item(i)
                If Left(oDict.Name, 5) <> "ACAD_" Or Trim(oDict.Name) = "" Then
                    ThisDrawing.Dictionaries.Item(i).Delete()
                End If
            Catch ex As Exception
                GoTo 200
            End Try
200:    Next
    End Sub
  End Module


Title: Re: Need Urgent Help - will pay.
Post by: vnsharifi on April 17, 2011, 12:31:40 AM


Ok Kerry. You are right. I stick with external Database. I am so frustrated and you just wake me up.
Today I just worked and worked. My kids and family are upset with me.
Title: Re: Need Help Urget - will pay.
Post by: Kerry on April 17, 2011, 12:47:58 AM
No, I'm not right or correct ; I never made a suggestion ... all I did was ask some questions so we can understand what you are trying to do.

I find it amusing how you have not really answered questions or posted the main block or sample drawings.


I'll try again :

What is the primary goal/purpose of the application you are designing ?
What are any secondary goals ?
How do you intend to achieve these goals ?

Try to answer these without using programming function terms.

Regards,
 
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 17, 2011, 01:43:24 AM
Quote
Linking Circles, Part 1: Using .NET events to relate AutoCAD geometry

I used those online convertors to make a vb. Attached please find the the file. I have no idea about Namespaces and Assemply . and get some
error which don't know how to fix them. Can some body help me. to have erro free code .So I can dig in. Thanks.
(http://)
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 17, 2011, 02:11:32 AM


Quote
I find it amusing how you have not really answered questions or posted the main block  or sample drawings.
Reply # 21 has the one of 40 Blocks which I made.Like I said in my project description in same reply. All drawings are handsketch.
there is no electronic drawings. I am going to give them this utility.
They just bought Autocad. everything used to be  marked on hardcopy archtiect drawing ,manualy
and input in Excel.


Quote
What is the primary goal/purpose of the application you are designing ?
Like I said in Reply #21, To combine multiple tags where the  fields in their records are the same.
To reduce shop work and make life easier for foreman to find Tags on Job.

Quote
What are any secondary goals ?
Having a nicer drawing instead of a handmade drawing. Right now after they get the project. General contactor give them a copy of
architect drawing and they start putting Labels on that drawing manually and they put data in excel seperately for each label.
since  this is a manual job they don't keep track of similar lables.
I mean it is quite possible 2 bundles of fibergalss are exactly the same but with 2 different Tags on it. for evertag shop operator has to reset machine.


Quote
How do you intend to achieve these goals ?
Really don't know. Database point of view I have no problem . I am expert in that matter. I finished a lot of project .
Just Autocad point of view.I am confused. But I explained in detail what I need. But don't know How to achieve that inside autocad.

Thanks again for listening and paying attention.

Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 17, 2011, 02:29:29 AM
All drawings are handsketch.
there is no electronic drawings. I am going to give them this utility.
They just bought Autocad. everything used to be  marked on hardcopy archtiect drawing ,manualy
and input in Excel.

That is probably why the ObjectARX solution was slow I have heard they do not run very fast on paper.
Title: Re: Need Help Urget - will pay.
Post by: Kerry on April 17, 2011, 02:38:46 AM
All drawings are handsketch.
there is no electronic drawings. I am going to give them this utility.
They just bought Autocad. everything used to be  marked on hardcopy archtiect drawing ,manualy
and input in Excel.

That is probably why the ObjectARX solution was slow I have heard they do not run very fast on paper.

Yep, and also probably why one of the criteria is that the block names can't be changed .. the whiteout looks so ugly on the monitor.

 :|

This is probably a late April Fools joke gone wrong.

Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 17, 2011, 03:26:53 AM
Well, What can I say. I will create a drawing with that faulty program ObjectArj. will submit to you Tuesday. They never were able to create a working drawing off that  Program and that is why I am a replacement. I think my command of English is not understanable here. Like the same Boo Boo I made for DAD. and It was cleare. There are more misundestanding.
Anyways. Thanks for all your investigation and help.

Title: Re: Need Help Urgent - will pay.
Post by: Kerry on April 17, 2011, 04:36:36 AM
I will create a drawing with that faulty program ObjectArj. will submit to you Tuesday. They never were able to create a working drawing off that  Program and that is why I am a replacement. < .. >

You said previously that the ARX was too slow. Are you saying now that it doesn't work. ?

You stated that there are 80 values associated with each tag.
How are these entered ?
How are they saved ?
What are they used for ?


added:
vnsharifi, I see you are from Canada.
What is your native language ?
Title: Re: Need Help Urgent - will pay.
Post by: vnsharifi on April 17, 2011, 11:32:07 AM
I will create a drawing with that faulty program ObjectArj. will submit to you Tuesday. They never were able to create a working drawing off that  Program and that is why I am a replacement. < .. >

You said previously that the ARX was too slow. Are you saying now that it doesn't work. ?

You stated that there are 80 values associated with each tag.
How are these entered ?
How are they saved ?
What are they used for ?


added:
vnsharifi, I see you are from Canada.
What is your native language ?

Kerry,
I am so sorry, I asked help from you. Look what are you saying my friend.
You looked into profile to be able to make fun of me? !! Bad Boy.
I am embarrassed even to mention that. Now after reviewing this story again I just noticed something interesting. Are you integrating me to find the source of company to get the project for yourself? Is that all about? Project has enough money I was willing to share it with you happily. You were the one who claimed to will help me for free to make it visible for everybody to learn.
When you work in a team you don’t need to know about all aspects of project. You write your part and somebody else writes his part. And somebody else  will combine them. If you keep asking these non-related questions Just  find the company name. Why didn't you asked at first place instead of all these harassing.
Now after all this I dare to return your attitude to yourself, I apologize from everybody else to make this thread so unprofessional.
1-Why didn’t you see Ushape dynamic block file at first place On Reply #21, where everybody else found it?
2-Did you read the project details on Reply #21? How come Jeff completely understood it and made a simple drawing as a simple plan and you still don’t get it?
3- Are you a giver or taker?  How come when I asked a simple question regard  with  ObjectId  values are not being hold, after a drawing opens and close ,, Lee mark from nowhere , just  put a comment and solved the problem and after that Jeff put extra note to re-clarify it again(So nice o him ) Where have you been that time?
4-Why don’t you provide any snip code at all?  I check randomly a few other threads .I doesn’t see so many codes there. Are you a giver or taker?
5-Do you think, have you ever been able to answer to one of my stupid/ novice/elementary questions so far? Mark Lee and Jeff were able to solve a lot of my questions. What about you?
6- Are you always  find it fun and enjoyable   to put people down, and find a lack in their  abilities?
It is up to you to stay in this  forum for free to learn (IF YOU NEED IT) or if you are really a programmer and know things, I will pay you $2000 to write a function to do whatever Jeff showed on his sketch (It is big enough you won’t miss it, like the way my block was missed and I was accused at first place). That is your part. If I see you have ability to finish things  then I will give you another fucntion, I have limited time with these guys I need men who could do/finish things.  Money would be good if you have enough experience and skills, I don’t. I  hope yours  is not cripple like mine( But the truth is I haven’t seen anything  to prove it) . You don’t need to know anything else about database, shop, field (I made a big mistake  even  mentioned it at first place)  and other stuff. Please only put technical and code related comment. And  only put,  If you can give me a  code which could accomplish Jeff sketch. Either for Money or for free. It is up to you.  I will use your code as function in core program which I am working on it. 
Regard with your question. I started to Learn English 2 Years ago. English is 4th language I am learning.
Originally I speak French (My mother language) .Other Language I speak I like my English (So and so).
Answer to the rest of questions would be rely on either you have capability to finish Jeff sketch or not. I don’t have time to translate  from French to English. This is business doesn’t take it personally and that small Jeff sketch is your passport to make everybody believe your skills is not crippling. I have been working in big companies when there is a project all the functions are being distrubted between programmers and somebody ( PA) will combine them. How don’t how things are being done in your country. But here in North America that is the way it is. So prove to us what you know buddy.
Hurry. Man, give us Jeff Sketch in Vb.net and  I will put 2000$ PayPal receipt on this forum  after you finish that part. And then I will apologize from you in front of everybody  for accusing your skills level  to be compared to some stupid person like me.
Regards,









Title: Re: Need Help Urget - will pay.
Post by: JohnK on April 17, 2011, 12:41:26 PM
I have not read any of this thread other than the last post but I consider Kerry a friend of mine and what was said in the last post does NOT describe Kerry at all!  Kerry is a very good programmer and he does know several programing languages and if all of the languages he does know was not enough he can have anything i wrote/write and claim it as his.

Kerry was most likely trying to help you understand some area or problem he foresaw with your logic or code. He was most likely trying to convey his experience to help shape your code.

I apologize for my outburst; I will go back and read more of this thread now.
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 17, 2011, 02:56:16 PM
The problem with Kerry is he does things in a intelligent, efficent, well organized manner and actually is being the most helpful by trying to get a detailed description of the problem.


Seriously, I think Kerry is doing the best thing for you by trying to get a detailed description of the problem.

You will find the guys with the most knowledge and best advice do not just post a bunch of code.
That is for guys like me who have gained enough knowledge to know good places to find answers and then post the code in a effort to look smart.

This has made me think I probably have done more harm than good by just posting code and I am not talking about this thread.
I have posted code to questions asked and then later when I see what they were actually trying accomplish I wish I have never posted it.
Kerry could be trying to prevent this.

Honestly I think you getting a false sense that you are making gains toward a solution and Kerry could be trying to help you by stopping this now then it blowing up on you later.


Kerry is the only one that is actually helping you.
By asking you questions he is trying to make you think, and addressing questions that need a full explanation for this project to be sucessful.

For example:
Why are storing the info in the drawing?
Should be answered with valids reason why and why other approaches would not be better.
This helps to make sure you are solving and understanding the correct problem, better advise can be given because people better understand problem.
 

When you work in a team you don’t need to know about all aspects of project. You write your part and somebody else writes his part. And somebody else  will combine them.
True but someone needs to fully understand the problem first before they can correctly break up the project in smaller parts.
You will be the one combining them, and trying to make sure your parts fit.
Would you hate to get it all together just to find out you not able to combine them?

Quote
Mark Lee and Jeff were able to solve a lot of my questions
I think Kerry knows that sometimes the questions being answered might be more harmful than good.
You could be creating a solution for problems that do not exist and help in no way solving original problem.
He might be trying to prevent this from the very begining instead of weeks of wasted work being done and nothing to show for it.

Quote
Are you a giver or taker?
The code I posted I probably stole from Kerry so does that count as a giver?

Quote
Did you read the project details on Reply #21? How come Jeff completely understood it

I really do not.
Maybe I underatand what your post ask for,
but I do not understand how what asked for or given would be any real use

Quote
Why didn’t you see Ushape dynamic block file
Can you promise and know for sure that this one drawing represents every possible block that will be used?
That code written that works for this one drawing will work on all other possible blocks to be used?
How do know what logic will be used and the code written will work on other blocks?
If it were me I would want to know and be testing on every single block that could be used

Quote
You don’t need to know anything else about database, shop, field (I made a big mistake  even  mentioned it at first place)  and other stuff.
Take a minute and think about it. Really think about it.
How does hiding that info help anyone give a better solution?

You are putting yourself in a situation to get completely ripped off.
It would be easy to create a solution for what you asked, but it is so obivious you do not understand or do not want to address some very important issues.
The issues you do not want or  don't understand to address are some of the more annoying ones.
So you are willing to pay someone for a solution that they do not have deal with any annoying matters and knows it will not end up working.

Kerry might be trying to keep some guy dropping in and taking your money.
Title: Re: Need Help Urget - will pay.
Post by: Kerry on April 17, 2011, 06:57:38 PM

Definitions of profile on the Web:
Quote
•an analysis (often in graphical form) representing the extent to which something exhibits various characteristics; "a biochemical profile of blood"; "a psychological profile of serial killers"


or the SHAPE of a U bend.

I used the word several times.

The rest I will ignore,
bye,
Title: Re: Need Help Urget - will pay.
Post by: Kerry on April 17, 2011, 07:00:56 PM
Jeff, Thanks for the support. Your analysis of my intent was almost perfect.


added:
When faced with contradictory information the only thing to do is ask (if you care) ... or ignore it all.
Title: Re: Need Help Urget - will pay.
Post by: Glenn R on April 18, 2011, 05:31:39 AM
I'll invoke the 'barge pole' rule for myself me thinks.
Title: Re: Need Help Urget - will pay.
Post by: LE3 on April 21, 2011, 09:50:49 PM
I see where the topic it is now... well since I am out of town and before came here, was able to put some of my stuff together for a basic USHape custom object ARX (template), it is not complete (of course) but my guess it might work.

- For AutoCAD 2010-11 32bits.

- The files are provided as-is no source code, just want to demonstrate that can be done via custom object like Kerry recommended or mentioned.

- Included are two binaries (DBX and ARX) - Open AutoCAD and loaded the DBX first then the ARX.

- Call the command: USHAPE (select two points the start and end point, by default the U height it is drawn at 2.5, try to draw it first using Or tho ON (F8))

- Then draw some AutoCAD entities let say on top of the ushape, maybe some circles.

- Call the command: AITEMS (Select the ushape object, then select one by one the circles to be attached to the ushape)

- Now, move the USHAPE to any other area.... select the USHAPE and stretch the u end points, use the grip point on the left-upper corner to modify the u height.

- Use COPYCLIP on the USHAPE and then PASTE and see if a new USHAPE it is drawn and also with new circles, and test if they are attached.

- Now, erase the USHAPE, and see if all the attached entities are erased too.

- Erase any of the attached entities and see if the USHAPE it is erased too.
Title: Re: Need Help Urget - will pay.
Post by: mohnston on April 22, 2011, 01:29:00 AM
I had a few minutes to try it out.
Using AC 2011 Win 7 32 bit

- For AutoCAD 2010-11 32bits.

- The files are provided as-is no source code, just want to demonstrate that can be done via custom object like Kerry recommended or mentioned.

- Included are two binaries (DBX and ARX) - Open AutoCAD and loaded the DBX first then the ARX. Loaded successfully

- Call the command: USHAPE (select two points the start and end point, by default the U height it is drawn at 2.5, try to draw it first using Or tho ON (F8))Ran successfully - drew 2 ushapes

- Then draw some AutoCAD entities let say on top of the ushape, maybe some circles. Drew circles and polygons

- Call the command: AITEMS (Select the ushape object, then select one by one the circles to be attached to the ushape) Success

- Now, move the USHAPE to any other area.... select the USHAPE and stretch the u end points, use the grip point on the left-upper corner to modify the u height. ushape behaves differently based on grip selected. Attached objects are unaffected by ushape grip edit.

- Use COPYCLIP on the USHAPE and then PASTE and see if a new USHAPE it is drawn and also with new circles, and test if they are attached. Ushape and attached entities are copied. When the ushape copies are moved the "attached" entities do not move with them as they do with the original ushapes and their entities.

- Now, erase the USHAPE, and see if all the attached entities are erased too. When ushape is erased attached entities are erased. This is true of the originals and the copies.

- Erase any of the attached entities and see if the USHAPE it is erased too. When attached entity is erased ushapes are erased. This is true of the originals and the copies.

LE - you are a genius.
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 22, 2011, 08:58:34 AM
Yes ,Le That is what I want ,exactly, That is great. Link is perfect and flawless. :-D
 :laugh:
Yes Kerry was right . But he didn't what you did . Action.
I am so glad you understood me. and I am sorry which this is done in an API ( ObjectArx) which I have  no clue about that. My fault . No offence.

After what you done I think I have to change  requirement and project detail.
But before that I need to know something . Answer this please and then we have business to do.

Now since It is done in an environment which I have no idea about it. I have a couple of questions.
1- I assume  you know  this shape  is one of 40 shapes. Do we have to write seperate code for each shape?
2- Do I have access to this Ushape Object thru dot net in order to read the leg lengths or change the leg lengths?
3- Shall you define the properties of this custom shape in your ARX code ? I mean by accessing means thru vb.net

I am sorry I thought you are a negative person. you were quiet  but an action guy. If you interested to be in touch personally I wrote my Email address at first  post. Cheers.




Title: Re: Need Help Urget - will pay.
Post by: LE3 on April 22, 2011, 09:24:52 AM
:)

This was just a simple implementation not to involved... have an 64bit machine here and no arx sdks to do any test, the copyclip-paste it is strange, that should be working, but will have a look as oon i go back (2+ weeks).

Each grip it is setup to do certain task... the ones on the lower-left will change the width or base, the lower-right changes the leg length, the upper-left changes the leg length, and the upper-left changes the heigth.

Again it is just a quick sample.

Thanks.

I had a few minutes to try it out.
Using AC 2011 Win 7 32 bit

- For AutoCAD 2010-11 32bits.

- The files are provided as-is no source code, just want to demonstrate that can be done via custom object like Kerry recommended or mentioned.

- Included are two binaries (DBX and ARX) - Open AutoCAD and loaded the DBX first then the ARX. Loaded successfully

- Call the command: USHAPE (select two points the start and end point, by default the U height it is drawn at 2.5, try to draw it first using Or tho ON (F8))Ran successfully - drew 2 ushapes

- Then draw some AutoCAD entities let say on top of the ushape, maybe some circles. Drew circles and polygons

- Call the command: AITEMS (Select the ushape object, then select one by one the circles to be attached to the ushape) Success

- Now, move the USHAPE to any other area.... select the USHAPE and stretch the u end points, use the grip point on the left-upper corner to modify the u height. ushape behaves differently based on grip selected. Attached objects are unaffected by ushape grip edit.

- Use COPYCLIP on the USHAPE and then PASTE and see if a new USHAPE it is drawn and also with new circles, and test if they are attached. Ushape and attached entities are copied. When the ushape copies are moved the "attached" entities do not move with them as they do with the original ushapes and their entities.

- Now, erase the USHAPE, and see if all the attached entities are erased too. When ushape is erased attached entities are erased. This is true of the originals and the copies.

- Erase any of the attached entities and see if the USHAPE it is erased too. When attached entity is erased ushapes are erased. This is true of the originals and the copies.

LE - you are a genius.
Title: Re: Need Help Urget - will pay.
Post by: LE3 on April 22, 2011, 09:52:31 AM
The base class it is the UShape but it is easy to derive from this one to add any other shape to change it graphically if that what you mean about the 40 different shapes (or that they are not an U).

I am very busy at least for the next 3+ months, and after that might only have a chance to do some side work on my weekends but that it is not for sure.

To access this object via C# or VB.NET the easy way it can be done with PInvoke, or the fancy way but more involved and of course a better approach is to make a NET wrapper.

Any method can be added to the ushape class and can be exposed via pinvoke as mentioned above, there can be for example three texts objects to be a part of the custom object, that once they are edited, it can change the shape length's or graphics.

The good about something like this, is that you have your own container, no need for a group or block or dblock, or to use reactors, etc, and the entities can be still part of your container and modified separatly but they are associated, this it is based on one of my previous solutions, where i spent 14+ months on the making.

And nope I do not take anything personal anymore - have more better things to worried now :)... people here are nice, been here for a long time...

 

Yes ,Le That is what I want ,exactly, That is great. Link is perfect and flawless. :-D
 :laugh:
Yes Kerry was right . But he didn't what you did . Action.
I am so glad you understood me. and I am sorry which this is done in an API ( ObjectArx) which I have  no clue about that. My fault . No offence.

After what you done I think I have to change  requirement and project detail.
But before that I need to know something . Answer this please and then we have business to do.

Now since It is done in an environment which I have no idea about it. I have a couple of questions.
1- I assume  you know  this shape  is one of 40 shapes. Do we have to write seperate code for each shape?
2- Do I have access to this Ushape Object thru dot net in order to read the leg lengths or change the leg lengths?
3- Shall you define the properties of this custom shape in your ARX code ? I mean by accessing means thru vb.net

I am sorry I thought you are a negative person. you were quiet  but an action guy. If you interested to be in touch personally I wrote my Email address at first  post. Cheers.
Title: Re: Need Help Urget - will pay.
Post by: Kerry on April 22, 2011, 10:03:40 AM
Yes ,Le That is what I want ,exactly, That is great. Link is perfect and flawless. :-D
 :laugh:
Yes Kerry was right . But he didn't what you did . Action.
I am so glad you understood me. and I am sorry which this is done in an API ( ObjectArx) which I have  no clue about that. My fault . No offence.

< .. >


Yes, vnsharifi, I was correct, which I knew all along.


Do you have the Dynamic block built ??

I don't believe a program conforming to your specifications can be build in .NET, or lisp (com based) .
Perhaps ObjectARX using custom objects would satisfy parts of your requirements.


However you continued to insist you wanted this in vb.net and berated me because I asked questions and wouldn't program it for you.
I hope you your sake that LE can find the time to program this for you, but be aware that he has his own job to service.

Just so you know, I don't program in ObjectARX ( which is another reason for my "Inaction" as you call it), however I do understand the process required and know how much more information you will need to provide.


Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 22, 2011, 10:21:46 AM
Yes ,Le That is what I want ,exactly, That is great. Link is perfect and flawless. :-D
 :laugh:
Yes Kerry was right . But he didn't what you did . Action.
I am so glad you understood me. and I am sorry which this is done in an API ( ObjectArx) which I have  no clue about that. My fault . No offence.

< .. >

I am Sorry Kerry.



Yes, vnsharifi, I was correct, which I knew all along.


Do you have the Dynamic block built ??

I don't believe a program conforming to your specifications can be build in .NET, or lisp (com based) .
Perhaps ObjectARX using custom objects would satisfy parts of your requirements.


However you continued to insist you wanted this in vb.net and berated me because I asked questions and wouldn't program it for you.
I hope you your sake that LE can find the time to program this for you, but be aware that he has his own job to service.

Just so you know, I don't program in ObjectARX ( which is another reason for my "Inaction" as you call it), however I do understand the process required and know how much more information you will need to provide.



Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 22, 2011, 10:22:30 AM
Yes ,Le That is what I want ,exactly, That is great. Link is perfect and flawless. :-D
 :laugh:
Yes Kerry was right . But he didn't what you did . Action.
I am so glad you understood me. and I am sorry which this is done in an API ( ObjectArx) which I have  no clue about that. My fault . No offence.

< .. >


Yes, vnsharifi, I was correct, which I knew all along.


Do you have the Dynamic block built ??

I don't believe a program conforming to your specifications can be build in .NET, or lisp (com based) .
Perhaps ObjectARX using custom objects would satisfy parts of your requirements.


However you continued to insist you wanted this in vb.net and berated me because I asked questions and wouldn't program it for you.
I hope you your sake that LE can find the time to program this for you, but be aware that he has his own job to service.

Just so you know, I don't program in ObjectARX ( which is another reason for my "Inaction" as you call it), however I do understand the process required and know how much more information you will need to provide.







I Am Sorry Kerry.
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 22, 2011, 10:57:12 AM



LE,
In 3 months I would be fired by them.
I need your expertise for sure and you are busy.
Let's make it simpler.
Do you have time for this ?


Instead of a custom u shape or all other 40 shapes.

1-How about a custom  DText. Let's name it LETEXt.
It would be exactly like DTEXt . except the name WHICH IS LETEXT


2- And of course  [Container] ( that is a good word ) . I like it. Not Block,Not Dblock and Not a Group.

3- Your  [AITEMS]  Command. Which is the beauty of your job.

4- Teach me how to manipulate this LETEXT from VB.net. I don't know about Pinvoke.
     By teaching I mean just show me how to put a LETEXT on drawing from VB. Just a sample

That's it.

If you give me this . I would able to fudge something for my presentation  to company boss
( I will include some reator to  bring the blocks seperately for now  which is not what I like to do. )
and then I can keep my job until you have done with your job and we do it properly after 3 months.

Is this affordable ?. I know I am pushing . But I have to . Again I don't expect any free work.

Thanks ,


Title: Re: Need Help Urget - will pay.
Post by: LE3 on April 22, 2011, 11:19:20 AM
I am very sorry, but do not have time. :-(

Let's make it simpler.
Do you have time for this ?
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 22, 2011, 12:15:39 PM
I am very sorry, but do not have time. :-(

Let's make it simpler.
Do you have time for this ?


Not a problem. You made me happy for one hour.
Title: Re: Need Help Urget - will pay.
Post by: Draftek on April 22, 2011, 12:19:28 PM
I, for one will be sad to see this thread end.
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 22, 2011, 05:47:46 PM
vnsharifi,

I hope you did not think my last post was trying to be rude or anything of the sort. I was just letting you know Kerry and everyone here is very nice and helpful.
I am surprised they have not tried to run my dumb arse off or if they have I was to dumb to notice.

The main point was getting some more information because there is always someone out there with a better idea and in my case there is a ton of people out there.

Looking back at some of your post it might be better to build your objects from what was entered in Excel or instead dealing or fighting with what the designers enter, you could create a Application that takes of these issues.

Instead of auto incrementing the number for labels creating a organized logical creation of them which would help all the people involved, just need some more info on the best way to accomplish this.
It would be easy to print labels that go with each object that have specific sheet number and location to help for installation on site.
etc.......

I would be happy to help any way I can even talking Skype, phone and have SmartDraw, Visio and could create flowcharts and process flow that could be posted, and you would be amazed with the ideas these people here would come up with.
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 22, 2011, 11:51:56 PM
vnsharifi,

I hope you did not think my last post was trying to be rude or anything of the sort. I was just letting you know Kerry and everyone here is very nice and helpful.
I am surprised they have not tried to run my dumb arse off or if they have I was to dumb to notice.

The main point was getting some more information because there is always someone out there with a better idea and in my case there is a ton of people out there.

Looking back at some of your post it might be better to build your objects from what was entered in Excel or instead dealing or fighting with what the designers enter, you could create a Application that takes of these issues.

Instead of auto incrementing the number for labels creating a organized logical creation of them which would help all the people involved, just need some more info on the best way to accomplish this.
It would be easy to print labels that go with each object that have specific sheet number and location to help for installation on site.
etc.......

I would be happy to help any way I can even talking Skype, phone and have SmartDraw, Visio and could create flowcharts and process flow that could be posted, and you would be amazed with the ideas these people here would come up with.
Jeff,
I know you. I always appreciate you. Right now I am using that small piece of code you post earlier here to
Change the dimension of legs in Dynamic blocks as my main routine-It was piece of work.
 2 other people are helping me, one in Russia and one in U.K. They never post anything in my thread but they are reading it .They have free time
 and have more experience than me. I know people here are nice.
 I just scared to lose this job. That is it.
I am pretty sure I will face into some question and I will come back to you and here.
My solution is LE and that is what exactly I want. I have to learn Object Arx after I established MY position.
But right now I need to fudge something to keep the job.
Cheers
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 24, 2011, 08:03:12 PM
Can somebody  please take a look at this.
Make a class and copy paste code below to your class.
Command name is  “  DCLICK  “

After executing  DCLICK.  Double click on any object on drawing. It will show the message box.
But as you will see after  command is finished Properties Pallete shows up.
If you close it again. Still it will pops up after another double click on objects. How to prevent that ?
Cheers,
Code: [Select]
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.EditorInput
Imports AcApv = Autodesk.AutoCAD.ApplicationServices.Application
Imports AcOp = Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Runtime
Public Class DBLCLICKClass1
    Public AcDoc As AcOp.AcadDocument
    <CommandMethod("DCLICK")> _
    Sub doubleclickeventstart()
        If AcDoc Is Nothing Then
            AcDoc = CType(AcApv.DocumentManager.MdiActiveDocument.AcadDocument, Autodesk.AutoCAD.Interop.AcadDocument)
            AddHandler AcDoc.BeginDoubleClick, AddressOf acdoc_BeginDoubleClick
        End If
    End Sub
    Private Sub acdoc_BeginDoubleClick(ByVal PickPoint As Object)
        Dim MdiActiveDocument As Document = AcApv.DocumentManager.MdiActiveDocument
        Dim GetSelection As PromptSelectionResult = MdiActiveDocument.Editor.GetSelection()
        Using DocumentLock As DocumentLock = MdiActiveDocument.LockDocument()
            If GetSelection.Status <> PromptStatus.OK Then Return
            If GetSelection.Value.Count <> 1 Then Return
            Dim ObjectId As Autodesk.AutoCAD.DatabaseServices.ObjectId = GetSelection.Value(0).ObjectId
            Using Transaction As Autodesk.AutoCAD.DatabaseServices.Transaction = MdiActiveDocument.TransactionManager.StartTransaction()
                Dim DBObject As Autodesk.AutoCAD.DatabaseServices.DBObject = Transaction.GetObject(ObjectId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForWrite)
                Dim Entity As Autodesk.AutoCAD.DatabaseServices.Entity = TryCast(DBObject, Autodesk.AutoCAD.DatabaseServices.Entity)
                If Entity Is Nothing Then
                    Return
                    Transaction.Abort()
                Else
                    Transaction.Commit()
                    MSGBOX(Entity.Handle.ToString)
                End If
            End Using
        End Using
    End Sub
End Class

Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 25, 2011, 12:02:05 AM
Quote
DBLCLKEDIT

Controls the double click editing behavior in the drawing area.

Double click actions can be customized using the Customize User Interface (CUI) Editor. The system variable can accept the values of On and Off in place of 1 and 0.

http://docs.autodesk.com/ACD/2011/ENU/filesACR/WS1a9193826455f5ffa23ce210c4a30acaf-50aa.htm

Also take note
Quote
Overview of Double Click Actions

Double click actions execute a command that displays either the Properties palette or a specialized editor that is more powerful, convenient, or frequently used for the object type that is double-clicked in a drawing. The following table shows the definition of the Attribute Block double click action in the CUI Editor
http://docs.autodesk.com/ACD/2011/ENU/filesACG/WS73099cc142f487557579ab9211cb86298f7-69c6.htm#WS73099cc142f487557579ab9211cb86298f7-69c5

Read link above as this will disable other ' Double Click Actions' and do not forget about 3rd-parties tools
Code: [Select]
Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("DBLCLKEDIT", 0)
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 25, 2011, 11:03:27 AM



Thanks Jeff,
Title: Re: Need Help Urget - will pay.
Post by: vnsharifi on April 29, 2011, 10:42:45 PM
Just Let you guys know . Fixo was abled to link objects to each other in vb, very simple and less than a week . He is a genius.
No objectArx and a simple Russian invention.
He created a nice container. unbelieavable. It is up to him to disclose the code and I need his permission  . He didn't like the way I was treated here in this forum. Thanks a lot for his help and I really appreciate all hidden helps I got here.
To me this thread is closed and thank all for help! Now I have a permanent job Man and can feed my family.
Title: Re: Need Help Urget - will pay.
Post by: Jeff H on April 30, 2011, 10:12:58 AM
Just Let you guys know . Fixo was abled to link objects to each other in vb, very simple and less than a week . He is a genius.
No objectArx and a simple Russian invention.
He created a nice container. unbelieavable. It is up to him to disclose the code and I need his permission  . He didn't like the way I was treated here in this forum. Thanks a lot for his help and I really appreciate all hidden helps I got here.
To me this thread is closed and thank all for help! Now I have a permanent job Man and can feed my family.

I know Augi's .NET forum is kinda like the CSPAN of .NET forums but you still might want to remove code if you do not want it seen by 2 or 3 people.

As usual Fixo very nice!!!
http://forums.augi.com/showthread.php?t=129638
Title: Re: Need Help Urget - will pay.
Post by: fixo on April 30, 2011, 03:30:01 PM
Sorry guys
you're wrong
In reality I'm semy-mad old man with crashed brain after
the few ishemic stroke attacks
I'm just a hacker, kinda the stupid parrot and nothing else
(Jeff, trust me, you will be have a great future with your quick brain
I always like your code and quick answers, it means much)
In fact I'm exactly from *top-6 billions* or so
So please, no flowers, gents

With regards to nice community

I love you all

(just very worring about TT every day, indeed)

Oleg

Title: Re: Need Help Urget - will pay.
Post by: Jeff H on May 02, 2011, 11:03:36 PM
Sorry guys
you're wrong
In reality I'm semy-mad old man with crashed brain after
the few ishemic stroke attacks
I'm just a hacker, kinda the stupid parrot and nothing else
(Jeff, trust me, you will be have a great future with your quick brain
I always like your code and quick answers, it means much)
In fact I'm exactly from *top-6 billions* or so
So please, no flowers, gents

With regards to nice community

I love you all

(just very worring about TT every day, indeed)

Oleg



The stuff you post is great and I have learned alot from it.
Please keep it comin
Title: Re: Need Help Urget - will pay.
Post by: fixo on May 03, 2011, 11:13:45 AM
Thanks, Jeff
I will
Many regards

Oleg