Virginia House of Delegates Democrats today chose Albert H. Grenadier over former House majority leader James M. Thomson for an Alexandria judgeship, upholding a political tradition that gives Democratic delegates power to name judges in their districts.

Del. Richard R.G. Hobson (D-Alexandria) warned his fellow Democrats that the long-standing unwritten rule of the caucus was at stake.

"I won't mess with your judge if you don't mess with mine," Hobson said. "I have adhered to that principle as long as I have been here and I ask you to adhere to it today."

Grenadier was named in a secret ballot by the House Democrats, 41 to 33. The vote was not announced, but was confirmed in interviews with several delegates.

Reached at his Alexandria law office, Grenadier said, "I'm really delighted. I've been very calm throughout the whole thing, but now I'm really excited."

Grenadier said it was Thomson who called him with the news. "Jim just called me 10 minutes ago and congratulated me, he said. "He seemed disappointed, but he told me he was glad the controversy was over and he said he would withdraw his name from consideration by the Senate side."

Thomson declined to be interviewed.

The House caucus action and Thomson's concession ended the most divisive judicial election in the General Assembly in memory. The Senate Democratic caucus is now expected to add its endorsement of Grenadier without controversy.

Thomson's defeat may not end his chances for a state judgeship. Hobson acknowledged that during the intense discussions before the caucus, Thomson's supporters suggested that he might later be a popular candidate for the State Corporation Commission or the Virginia Supreme Court if rejected for the Alexandria judgeship. The Alexandria legislators would be powerless to veto Thomson for a statewide judgeship.

The unusual rejection of a former House leader for a judgeship followed an acrimonious campaign in Alexandria. Thomson's opponents cited his record as a die-hard segregationist and unrelenting foe of the proposed Equal Rights Amendments.

The Alexandria Bar Association endorsed Grenadier over Thomson, 140 to 113, and a citizens commission appointed by Hobson recommended selection of Grenadier.

The two candidates, both 54, were seeking a state Circuit Court judgeship being vacated Thursday by the retirement of Franklin P. Backus.

Thomson's advocacy of racial segregation, restated as recently as 1971, turned opposition to his selection as a judge into a civil rights cause for some legislators, including the five black members of the General Assembly.

During a House session before the caucus meeting, Del. William P. Robinson Sr. (D-Norfolk), senior black member of the House, distributed copies of a 1971 newspaper story quoting Thomson's support of segregation at a meeting of the Alexandria Democratic Committee.

"This shows his position on desegregation and that he affirmed that position," Robinson told a reporter. "The black members of the assembly met a couple of weeks ago and decided we would oppose his nomination on the House floor no matter what the caucus decided."

Opposition to the choice of the caucus by the black members, all Democrats, would have broken another unwritten rule of judicial elections in the assembly. Democrats are pledged by that rule to support the caucus choice on the floor even if the caucus itself divided. Observance of this rule prevents the Republican minority from having a voice in the election of judges.

Today was the second time in less than two years that Thomson's record as a segregationist and foe of the ERA has contributed to his defeat for public office. After 22 years in the House, Thomson was defeated for reelection in 1977 by Republican Del. Gary R. Myers, who benefited from vigorous support by feminist campaigners.

Despite their disagreement with Thomson on civil rights issues, many Northern Virginia politicians publicly expressed regret over his 1977 defeat. It deprived the region of his skillful sue of power to win appropriations for Metro, George Mason University and other state-supported facilities in the Virginia suburbs of Washington.

The assembly has elected many former segregationists to state courts and it is likely that Thomson's ardent opposition to racial desegregation in the 1950s would have been overlooked, if not forgiven, had he himself allowed the memories to die.

During his 1971 reelection campaign, however, he answered a question by a black member of the Alexandria Jaycees at a public meeting by saying that he thought racial disturbances in the city's schools had proven that he was right on the desegregation issue.

The Alexandria Democratic Committee denounced his stand, but he told the committee members, "I do believe in a segregated society. I do believe the races get along better when they are not forced into commingling."

In 1977, Thomson pointedly told a reporter in an interview that he had stopped making segregationist statements after 1971, but he never had renounced his long held positions.

William Moffitt, a black Alexandria attorney, said he was "elated" by today's caucus vote.

"We weren't against Thomson the man, we were against what he represented to a large segment of the Alexandria community. Every once in a while the system is capable of doing what's just. In that sense, it's a victory for the community."